There are many historical legends (records) about the Yan and Huang Emperors
1. The Yan Emperor tribe lived in southern Shaanxi, and in the process of expanding eastward, it conflicted with the Yellow Emperor tribe. He fought with the Yellow Emperor at Banquan, but was defeated in three battles. He was forced to form an alliance with the Yellow Emperor and submit to him. From then on, the Chinese nation was formed.
2. The rise of the Yellow Emperor tribe to the west of Mount Tai. At the end of the Yandi tribe's rule of the world, due to the isolation of power, Wei was unable to command the world, and the Yellow Emperor fought with Emperor Yan to fight Banquan for the throne. Emperor Yan was defeated and was exiled. Chi You, the general of Emperor Yan, refused to obey and resisted with his cavalry. He fought with Emperor Huang and Zhuolu, but was defeated and died.
Later, because Emperor Yan had a high prestige and was missed by the people, Huang Emperor summoned Emperor Yan back to the court to assist in government affairs, thus forming the Chinese Alliance headed by Huang Emperor and Yan Emperor.
3. The Yandi tribe lived in the Wei River Basin and farmed. During the process of eastward expansion, they were expelled from the country by the local Chiyou. Later, they were defeated by the Yellow Emperor and Banquan because of their invasion of the princes, and formed an alliance with the Huangdi tribe. The alliance between Huangdi and Yandi gradually unified the various tribes. Chiyou refused to accept it and fought with Huangdi and Yandi in Zhuolu, but was defeated and died.
4. The two emperors, Yan and Huang, clashed in the process of mutual expansion to the east. They fought at Banquan. Emperor Yan was defeated and formed an alliance with Huangdi. After the alliance between the Yan and Huang tribes, their power expanded.
Later Chi You invaded the territory of Emperor Yan. Emperor Yan was defeated and was expelled to Zhuolu. He asked Huang Emperor for help. Yan and Huang united various tribes and allied with Chi You to fight against Zhuolu. They defeated 81 of Chi You's tribes and captured and killed him. Chi You (it is said that he was reused after being captured). Laying the foundation for the formation of the Chinese nation.
Extended information:
The victory of the Zhuolu War further expanded the power of the Yanhuang Tribal Alliance and developed into a larger tribal federation. The Yellow Emperor's authority was greatly improved, integrating judicial power, sacrificial power, military command power and production command power. All tribes must obey his orders. Those who do not obey his orders will send troops to conquer.
He also opened mountains and built roads, working hard to break up the isolation in tribal areas and enhance exchanges between tribes. Legend has it that the Yellow Emperor "never lived in peace" in his life. He died in Jingshan when he was on a tour of Henan at the age of 118. People escorted him back to northern Shaanxi and buried him on Qiaoshan in Huangling County, Shaanxi today. This is the Huangdi Mausoleum mentioned above.
Since the Yellow Emperor was later revered as the ancestor of China, later generations attributed many inventions in ancient times to him and his "ministers". For example, the Yellow Emperor built houses, dug wells, and sewn water. He made clothes and hats, made boats, chariots, bows and crossbows, smelted stone into copper, created musical rhythms, his wife Leizu invented silkworm breeding, his "minister" Cangjie created writing, Linglun made laws and regulations, Da Nao made armor, and so on.
For the same reason, since Emperor Yan was also revered as the ancestor of China, later generations also attributed some of his inventions to him and called him Shennong. In the legends of the Pre-Qin Dynasty, Shennong and Emperor Yan were originally two figures from different eras. Shennong lived earlier than Emperor Yan.
In the Warring States Period, people put the two people together and called them Yan Emperor Shennong. They said, "Shennong made the work, pruned the wood and made it into grass, and kneaded the wood into grass. The benefits of grass are to be taught to the world." "When you first taste a hundred herbs, you will find medicine." "He also made a five-string harp to teach people that the middle of the day is the market." These inventions are of course also the collective creations of people in primitive times.
Reference: Baidu Encyclopedia - Emperors Yan and Huang