The Emperor Shihuangdi traveled around looking for the source of eternal life, but he died, at the age of forty-nine. That was in 210 BCE. He had said his dynasty would endure for "generations without end,' but this was not to be. Dynasties would not provide a lot of political stability. With authoritarian rule, successions would often be trouble in China as they would be in Europe.
Eunuchs in Shihuangdi's palace, resorting to a politics of violence and not inhibited by an army of news people nosing around and describing what was happening, tried to hang on to their influence by murdering some of Shihuangdi's top aids. They kept the emperor's death a secret and sent a forged note to the emperor's son-and-heir ordering him to commit suicide. The son did, and the eunuchs made a younger son to the throne, whom they hoped to control.
News of Shihuangdi's death did circulate, and it produced attempts by the recently conquered to break away from the what had been Shihuangdi's centralized rule. Lords over vast stretches of land organized their own armies in an attempt to regain their former powers. And peasants joined the rebellions, expressing their displeasure at having suffered much forced labor on Shihuangdi's many construction projects. China was starting a centuries-long cycle of disintegration, integration and disintegration again.
The fight for power narrowed to two military leaders. One was Xiang Yu, who was excessively violent in trying to win obedience. He has been described as slaughtering defeated troops, as looting and seizing attractive women. He lost to a former policeman, Liu Bang. He was more mindful of the benefits from considering hearts and minds. He added to his following by being conciliatory and converting soldiers he had defeated. He surrounded himself with men of intelligence. In 206 he became the first emperor of what was to be the Han Dynasty (the name Han referring to a fief awarded him.) Liu was his family name. In power, Liu sought support from China's small farmers — its peasants. He lowered their taxes and protected them from lords trying to expand or retrieve lost lands.
After Liu died in 195 BCE he was given the title Emperor Gaozu of Han. Dynasties and successions were complicated by marriages, and Liu's wife, the Dowager Empress Lu, removed members of his side of the family from palace positions and replaced them with members of her family. She poisoned a son of Liu, and Liu's second son became emperor, dominated by his mother, the Empress. This son died in 188 BCE, and she died in 180 of an unspecified illness. Liu Bang's side of the family recovered their dominance, and to protect themselves they killed all of Empress Lu's side of the family. (The story of Empress Lu (Lu Zhi) is available online.)
A son born to Liu Bang's mistress became known as Emperor Wen (Wendi). He would rule 23 years, to the year 157 BCE. His reign is said to have "brought a much needed political stability" and to have laid "groundwork for prosperity." Emperor Wen introduced recruitment to the civil service through examinations. He provided relief to those suffering from famine. He freed many slaves. He studied economics, was frugal in spending money and kept taxes low for peasants. Under Emperor Wen, China enjoyed an unprecedented prosperity.
With prosperity, of course, came population growth. People move to new lands. Moderately wealthy families known as gentry moved to the cities. They became absentee landowners, and the males wished to be known as gentlemen, similar to noblemen or lords.
The gentry had time to read and were interested in China's old scholarship. They were attracted to Confucianism's concern with rank and authority. The first emperor, Shihuangdi, known for his hostility toward Confucianism, was accused of burying Confucian scholars alive and burning copies of Confucian works. Emperor Wen rehabilitated Confucius and promoted Confucian scholars to his government's highest offices.