According to legend, China was established by Emperor Yao. Rather than leave the empire to his degenerate son, Yao found the most worthy person, Shun, and made him heir. Shun did the same, settling upon Yu, who famously dug the channel for the Yellow River, saving the world from floods. These three sage emperors supposedly ruled by virtue, that is, by moral example without resort to force.
Yu broke the tradition of his predecessors and left the throne to his son, founding the first Xia Dynasty (traditional dates 2205-1766). Dynasties were typically thought to be founded by virtuous rulers and to gradually degenerate until they crumble under an evil King. Eventually, evil King Jie of the Xia was overthrown by the good King Tang, founder of the Shang Dynasty (1766-1122). The pattern repeated when evil King 紂 Zhòu of the Shang was overthrown by good Kings Wen and Wu, who founded the 周 Zhōu Dynasty (1122-256). These later kings were distinguished from the earlier sage emperors by their need to resort to force.
The Zhou Dynasty was a feudal system, with governments of states being handed out to members of the imperial family. Over time, these family bonds became weaker until, in 771, foreign invaders forced the Zhou to move their capital east, near modern Xian. Thus the Zhou Dynasty is sometimes divided into the earlier Western Zhou and later Eastern Zhou. The first part of the Eastern Zhou is referred to as the "Spring and Autumn" period (771-481). During this time, the authority of the emperor continued to decline, making it necessary for feudal lords to assert themselves as 覇 bà, "hegemons" or "strong-men," able to keep the peace. The first of these was Duke Huan, assisted by his minister Guan Zhong. 孔子 Kongzi, or "Confucius" (551-479), lived during this period. He wanted to restore the peace by returning to the traditions and virtues of the former emperors and kings. A generation later, 墨子 Mozi (flourished c. 430) proposed a progressive, indeed, revolutionary policy of basing political decisions on what benefited everyone equally, calculated in terms of the wealth, order, and total population of society.
Things continued to deteriorate until local rulers stopped paying even nominal loyalty to the Zhou emperor and assumed the title of 王 Wáng, "King," for themselves. Thus the Spring and Autumn was followed by the so-called "Warring States" (403-221). Along with the violence, there was also an explosion of intellectual activity, such that this period was also called the 百家 báijiā, or age of "a hundred philosophers," one of whom was Zhuangzi , trying to make sense of the intellectual turmoil. After his death, the Warring States were eventually unified in 221 by the 秦 Qín Dynasty (221-206), where we get our word "China."