Some people in China were probably forced into slavery as long ago as the Stone Age. Probably slavery was a way to pay off the debts that farmers can’t help falling into, or a punishment for stealing. By about 1000 BC in the Shang Dynasty, however, most slaves in China belonged to the government. Many slave women worked for rich families spinning and weaving silk. And both slave men and slave women worked in the fields planting and harvesting wheat and rice.
During the Han Dynasty, as the Silk Road connected China to Central Asian trading cities about 200 BC, rich people wanted more and more silk and other things to sell. So they also wanted more and more slaves to work for them. Many more Chinese people became slaves. After the fall of the Han Dynasty, the Three Kingdoms period saw a lot of experimenting with different ways of paying for work. Some people were more serfs than slaves, while others were sharecroppers or tenant farmers who rented their land. But there were still many slaves too.
Silk Road trade between the Islamic Empire and China brought black African people to China as slaves for the first time in the 600s AD. There were never very many Africans enslaved in China, but they were expensive and different. Rich Chinese families used African slaves as doorkeepers to show off their wealth. Around 1000 AD, in the Song Dynasty, Chinese law started to treat women as the property of their fathers and husbands. Many men sold their daughters or sisters into slavery to raise money for the family, or just to save money on feeding them. These women often worked in factories spinning silk, or did sex work.
With the Mongol conquest of China in the 1200s AD, tens of thousands of Chinese people were enslaved by their conquerors, as a punishment for resistance. Most of these slaves worked in the fields, planting and harvesting. Some, though, were educated or trained professionals who worked as carpenters, engineers, or government officials.
When China broke free from Mongol control in the 1300s, the Ming Dynasty freed all these slaves. But slavery soon went back to its traditional position in China anyway. There were fewer slaves than under the Mongols, but there were still a lot of slaves. Under the Ming Dynasty, the government still employed thousands of slaves as accountants and secretaries. Rich families still employed many other slaves as field workers, factory workers, and household servants (cooks, nannies, house cleaners, etc.). Pretty much any job that people now do for wages was a slave’s job in Ming Dynasty China.