The last ruler of the Han Dynasty was Emperor Xiandi. He wasn't a very good leader which lead to arguments. Under his reign, court officials became corrupt and worked for their own gain instead of the good of China. While the three most powerful groups were fighting, other forces were unsatisfied and had battled to take control and gain power.
Clansmen of the Empress
Emperor's servants & bodyguards
In China, the wealthy elite owned much of the land while the peasants had to work on it. The work they did helped the upper class to become richer while they were still poor. Hungry and powerless, they switched philosophies from Confucianism to Daoism.
The peasants became increasingly frustrated with their positions and the growing corruption in the government. They believed that the emperor's servants had more power that the emperor himself. So the peasants attacked the North China Plains in the Yellow Turban Rebellion. It continued for 20 years and had then turned into a time of uprising and political turmoil, ending the Han Dynasty.
In the north, a military inspector-general named Taizu founded the Song Dynasty. However, the northern side of the kingdom was destroyed by the Jin, so only the southern kingdom remained.
The era of the Song Dynasty was considered a golden age with the contributions of the Sui and Tang Dynasty. So to keep the reputation going, they followed the ideas of meritocracy from the Han Dynasty, for government jobs. The exams that they took were only for wealthy and well educated men.
During this time, the population greatly expanded. This led to the uprising of restaurants and food markets, theaters, seasonal festivals, and even their culture.