Wow, so many comments and no good answers. Let me take a crack at this.
Slavery in the sense of coercion of labor from people who are not free to choose their fate has a long history in China. For the most part, slaves came from various sources and were not always tied to race or ethnicity - although they sometimes were. Slaves could be peasants, commoners adopted as “sons” of noble families, eunuchs, Chinese or non-Chinese captured in wars, or later, small amounts of black slaves brought by an usually working under Europeans. My specialty is in early Modern and modern China, so that’s where I’ll focus. Much of this comes from Pamela Crossley’s article “Slavery in Early Modern China” in the Cambridge World History of Slavery.
As Crossley says, “If the essential core of slavery is the physical coercion of labor from individuals who are invisible as legal persons, a good deal of China’s social history will come under the ‘slavery’ rubric”. At the same time, “there is no precise parallel to the Roman legal construction of slavery. In China the absolute legal definition of slave status, or the associations with race and culture that might have inspired an equally absolute ideal of personal or national freedom, never emerged.” The same can be said of European/American style chattel slavery of the early modern and modern period.
There are a few reasons for this. First, in China, conceptions of property were traditionally more fluid and conditional than in Western legal traditions. “Chinese law and social institutions provided for instances of complete control by some people over others to whom they had no family relationship, people in China could not be reduced to res (a thing or object), because no res was defined in the law.” When the Ming empire discovered that Portuguese traders sold slaves as chattel Property, they forbade the sale of any Chinese to Portuguese traders - but did not forbid them from conducting their trade.
What kind of slavery existed? There was the ostensibly “voluntary” kind like concubinage, the aforementioned adoption of surrogate sons, and eunuchs. In practice while these groups could climb to great social heights, there were also laws proscribing their usurpation of the rights of nobles with a pedigree that did not include bondage. It also included aspects of sexual slavery, in the case of concubines, and forced mutilation, in the case of eunuchs. These were typically Chinese although some emperors famously took foreign concubines, especially in the Tang Dynasty. There were also “bondsmen” to noble houses, a category above slaves who had restrictions on their actions and were not usually paid for their work. There was also negotiated contracts a la “indentured servitude” that were legally negotiated in magistrate courts. Private sex slavery of women - prostitution - was the most common form of slavery throughout the empire.
Chinese law also differentiated people by “commoner” and “base” status. Commoners were born to their status and were generally more protected by laws than “base” people. Base status could be achieved by being born with congential defects, being a prisoner of war or criminal, or by being identified as “idle”, in other words despondently poor. As Crossley writes, “Poor people generally – and the base population specifically – performed the menial, nonagricultural tasks that were popularly despised. They guarded the fields, slopped night-soil, pounded earth (for building of walls and houses), gathered firewood, burned charcoal, and dug ditches and graves.” Only base status people could be enslaved by Chinese law. In times of war or large state projects, these restrictions were sometimes dropped, and mass corvee labor was the norm.
Crossley analyzes a customary wedding prayer from the early Qing period that illustrates the categories of slavery.
“Consistent with other documents for the period, the prayer carefully distinguishes between the status of house slaves (who are desired to be Chinese in this Chinese household) and farm and field slaves, who should be “foreigners.” Beautiful slaves (no gender specified) will take care of the entertainment, and as a final flourish, the link between perceived physical deformity and servility provides the punch line of the recitation:
Gold and silver to fill my coffers year after year,
Wheat and rice to fill my barns at every harvest.
Chinese slaves to look after these treasures,
Foreign slaves to tend my livestock,
Fleet-footed slaves to attend me when I ride,
Strong slaves to till the fields,
Beautiful slaves to strum the harp and fill my wine cup,
Slender-waisted slaves to sing and dance,
Midgets to hold the candle by my dining couch.”
I could go on about changes between the Ming and the Qing, but this should be enough to answer your question!
FULL INITIAL DISCLAIMER: This will not be a discussion of slavery in China in general, but rather practices of slavery and bonded servitude among one particular group specifically during the time of the Qing empire (1636-1912).
Jurchen/Manchu society was built on slavery. This was something ingrained not only in their social structure but also their political rhetoric, with the relationship between ruler and subject conceptualised explicitly as being equivalent to that of a master and slave. That is not to say that all subjects of the Jurchen khan/Manchu emperor were slaves as we would understand them. 'Slavery' as conceptualised in Northeast Asia was not exactly chattel slavery, where an enslaved person became seen as transferrable property, but rather refers to a more general state of political and economic unfreedom whereby one individual became bound to another individual or group in effective perpetuity. For that reason, I am going to treat booi ('bondservant') status as being a form of slavery within that Northeast Asian conception. As I understand it, the difference between indentured servitude and slavery in a European context is a significant one, but in a Manchu context bonded servitude was part of the broader category of slavery.
In pre-conquest Jurchen society, we can distinguish three rough classes – at the top were ᡳᡵᡤᡝᠨ irgen, the village heads; these commanded the allegiance of ᠵᡠᡧᡝᠨ jušen, men who owned farmland; and finally there were ᠠᡥᠠ aha (slaves) and ᠪᠣᠣᡳ booi (bondservants), who were considered bonded in servitude to jušen masters. As Pamela Crossley points out, though, the relationship between irgen and jušen could be considered in some ways comparable to that between jušen and aha, and a relationship of servitude became particularly apparent when, by the 1610s, one particular ᠪᡝᡳᠯᡝ beile ('prince'), Nurgaci (aka Nurhaci), had achieved sufficient control to start considering himself ᡥᠠᠨ han (Khan) of the Jurchens. Nurgaci's pronouncements reveal a paternalistic attitude from ruler to subject that corresponds with what we understand of prior Jurchen discourses as regards slavery: the enslaved person is conceptualised as a child in relation to the paternal figure of the master.
The origins of the aha and booi were various and not simply, as traditionally believed, exclusively Han Chinese war captives and their descendants. The booi companies of the Banner system appear to have been distinguished by ethnicity, and while Han Chinese were a significant part of them, there would have been ethnic Manchus, Mongols, and Koreans in the booi companies as well. A major cause for the increase in number of enslaved people during the early part of Qing rule seems to have been economic desperation: many people sold themselves or their family members into slavery during the chaos of the Qing conquest in the 1640s-50s, and this pattern repeated in some cases during times of natural disasters: in the 1720s, there were reports of peasants around the city of Jingzhou selling themselves to the Banner garrison following a period of major flooding. But captives of all sorts were the most consistently enslaved by the Qing state: not just prisoners of war but also, at times, criminals.
The precise structure of Manchu society underwent massive changes after 1644, for the simple reason that most of the Manchu population relocated from the Northeast Asian plain to urban centres in China, a move which brought with it some significant alterations. To explain them, it is worth bringing up what the terms aha and booi were understood to mean. Quoting directly from Evelyn Rawski's The Last Emperors, 'Whereas aha worked in fields, booi were in domestic service.' The term booi itself highlights this: boo means 'house[hold]', and the -i suffix converts it to possessive form, thus a booi is '[someone] of the house[hold]'. The number of aha in the Qing state thus became far less significant (especially as the Bannermen came to sell off most of their agricultural allotments in the provinces), and most aha would in fact be 'elevated' up to booi. Ownership of people as household servants became an expected part of Manchu identity as part of the means by which they distinguished themselves from their Han neighbours.
Over the course of the Kangxi reign (1661-1720) the number of booi in Beijing remained relatively steady at around 230,000, although the number of non-booi in the capital Banners increased considerably from around 150,000 to around 385,000. One noticeable increase was that of Hanjun, whose numbers increased from around 75,000 to just under 200,000, a change second only to the increase of Manchus from around 50,000 to 150,000. Events later in the eighteenth century, however, show that the booi population was not atypically static compared to the 'free' Banner population. Rather, many booi were working around the system. One of the great shocks that the Qianlong Emperor (r. 1735-96/9) faced was that he discovered that a substantial portion of his guards could not speak Manchu. While on the one hand perhaps reflective of declining language teaching standards (which he would go on to attempt to reverse), it seems the more significant issue (for the emperor at least) was that booi and other enslaved people in the Banenrs were exploiting loopholes and oversights. Most notably, many were having their children adopted by Manchu families, ensuring that even if they remained bonded, their children would end up in 'free' companies. Some 'entailed households', which were run by booi patriarchs who had gained some degree of elevation due to service to the state (such as in battle), also came to claim status as 'detached households', a category used to refer to households of full Bannermen where the patriarch held no official post. This state of affairs, unfortunately, did not last: by the 1750s the Banner administration began to much more actively monitor adoption processes and enforce the rule that Manchus were only to adopt Manchu orphans and that all orphaned Manchus had to be adopted by Manchus, irrespective of clan or sub-Banner affiliations, while the category of 'entailed household' was replaced with a more tightly monitored set of 'separate-register households'. From there on out, the bonded and enslaved members of the Banner system would remain as such until the end of the dynasty. There did remain, however, the option of outright escape, one with actually quite a high success rate. Coldo, the garrison commander at Xi'an in the early years of the Qianlong reign, reported that around 170-200 enslaved people escaped every year, of whom only 20 or so at most would ever be recaptured.
A final aspect I'd like to discuss, and one that must be treaded carefully, is the notion of Bannermen, even if not in the aha or booi, as 'slaves' of the emperor. I brought up the equivalencies of paternalistic rhetoric earlier, but the language used was very very clear: in memorials to the emperor, Bannermen referred to themselves in Manchu as ᠠᡥᠠ aha and in Chinese as 奴才 nucai, literally, '[this] slave'. This is in contrast to Han Chinese officials, who used 臣 chen ('[this] official'). Now, Bannermen were not chattel slaves, they were not considered the personal property of the emperor to buy and sell at his leisure. However, going back to the start again, within the Inner Asian conception of slavery as meaning a state of political and economic unfreedom, Bannermen were most certainly bound to the emperor's will in a manner that most imperial subjects were not, and this rhetoric is not simply a bit of flourish, but a real reflection of how emperor and, presumably, Bannerman, conceptualised their relationship. Mark Elliott highlights as a comparison the Janissary corps of the Ottoman Empire: relied upon to be effective in war and fiercely loyal, but whose status was clearly subordinated to their monarch, who reserved theoretically total control over their lives.
There is much about Manchu slavery as an institution that I haven't covered here, and much that I imagine I may not have covered all that well, but I hope it is, if nothing else, a start.
Sources, Notes and References
This is something exciting I'll admit ! As u/Xuande88 has taken a brief foray into variants of slavery in China and u/EnclavedMicrostate has gone into the idea of Manchu slave societies (Something I never knew by the way,super exciting stuff!) , I'll do something they didn't talk about! Let's talk about its roots and how the earliest forms of slavery were codified in Han China,how it became the 'norm',what it was like,who could become slaves,how they were treated, what were the numbers etc etc and how much we really know about this. (Spoilers: not a lot)
Slavery in China is both very old and very poorly recorded. The super-majority of the work done on comparative studies between the two halves of ancient Eurasia primarily focuses on intellectual differences,cultural differences etc (often between Greek and Chinese thinkers) and it's only really within the last decade and a half we see scholarship like Pamela's monograph on the nature of Chinese slavery. Most of the work is also done on earlier dynasties because the more you read on the topic,the further back it goes; ie "the slaves are treated this way because they've always been this way."
Who was the slave and the not-quite-a-slave-but-actually-is ?
I have to echo u/Xuande88's sentiment that Roman slavery and Chinese slavery cannot be actually compared side by side but I'll say that they weren't that dissimilar. In Roman Classical Law,everybody was either free or a slave but there were gaps in the non-slave population which included ‘slaves of the punishment’ (servi poeni) who existed outside of the obvious dichotomy. In early (Qin-Late Han) Imperial China (~221BC-266AD),this divide was between the 'good' and the 'base'. Those who were slaves ( 奴隸 ) must have committed some form of 'wrong' and hence deserved their punishment. In these early days,there was but one source of legal slavery ;the enslavement of the relatives of condemned criminals. While other sources existed,such as the kidnapping of young children or the capture of foreigners,they were strictly extra-legal. The oft-quoted enslavement of criminals was actually only recorded for one Wang Mang of the Xin Dynasty (9 to 23 AD) and is regarded to be thoroughly unusual for Chinese slavery. That is not to say that convicts did not work like slaves. Convicts were condemned to hard labor in mines and quarries and were functionally 'dead' in society's eyes,but were not technically,legally 'servile'. Moreover,illegal slaves did not 'technically' alter the status of free men in China. This was the baseline of Han Chinese slavery; You might work 7 days a week,get paid nothing,but you were,on paper,free. As for war slaves,this number gets even murkier because there is no mention of an explicit market that'd have supplied slaves to private buyers in Chinese Chronicles. In short, the number of people doing 'slave work' has been grossly underestimated in studies, but they're not actually recorded.
So how did Chinese slave society perpetuate itself if wars weren't too common and there was no explicit slave market ? Well,we don't know. The obvious go-to was that slave families could reproduce and produce more slaves to be sold,but there is another darker possible answer ; The illegal market for slaves might've been far larger than previously estimated with the poor and the disparate being kidnapped by private merchants or sold off to paid off their debts. A freed-man could also sell himself off as a 'servant' to pay debts and dues,further complicating his legal status. Due to the paucity of sources that mention war-slaves as being a credible,reliable source of slaves,the current idea is that the Chinese much favored internal slave supply over external sources and the conversion of free-men into slaves,coupled with the natural slaves (ie those from slave parents) was the primary source of slaves in China, a pattern that isn't particularly violated for Han Chinese dynasties.
What was the state doing or how did it become the 'norm' ?!
In a word,busy owning slaves. The primary reason why this system could continue was because the state was the foremost consumer of slave labor and thoroughly reaped its benefits. The enslaved-kin of criminals and all generations that succeeded them were considered state property and while allocation of state-owned slaves to the aristocracy was common,the Imperial government undoubtedly bore the lion's share. Moreover, the idea of a slave as being 'base' was thoroughly ingrained into society. The slave class was the lowest class,unworthy of thought or consideration for they must've had performed some form of crime to deserve this sort of punishment. This idea then evolved from base (卑) into foreign. Slaves from lands outside China were acceptable because they were already 'low' in the eyes of the Chinese. If the lowest of the low Chinese could become slaves,foreigners definitely could! There're however no recorded instances of a foreign slave in the Han period with the first references to the foreign slave trade being in the Tang Dynasty,with poets such as Yuan Zhen (779 – 831) referencing the fine quality of 'Vietnamese female slaves' and their beauty in his poem Gu Ke Le ( 估客乐 ).
So what was the state doing with them ?
Their role was probably as forced labor,free farming labor and as baggage trains for the army. Due to the size of the agrarian economy in early (and to be honest,most of its history ) China, farming slaves appear to be the most common and likely guess as to workforce distribution though there is very little textual evidence that supports this. However,we also don't know exactly how much they contributed to the Chinese economy. Did they displace local Chinese farmers on large farms or did they only work for affluent farmers ? Was they seen as a means to acquire greater wealth by selling and acquiring labor ? Was there kickback from the common people on Han Elite slaveowning ? What about the other sectors,such as salt farm mining or herders,shepherds or stable-hands,or even accounting of a family's finances ? Were more educated slaves allowed incentives and greater autonomy ? We don't know all these answers (Sorry lol) because the primary mention of slaves in chronicles,especially early Han ones primarily mentioned slaves as a prestige piece. Only the wealthy and the powerful could own and,hence,flaunt em.
Conscript and penal labor are recorded uses of the slaves though and they were used in conjunction with the mandatory corvée labor for the state, usually one month per year for most of the adult civilian population with service obligations beginning from about 18 to about their 50s. During the time these guys weren't working,the slaves were and there was always something to be done. They would be assigned tasks on dams,dikes and roads and there were always new palaces to be built. Most famously,the walls of Chang'An were ruined in the 190s BC and the Han,then in its infancy, conscripted 145 000 'conscripts' to rebuild it. In my opinion,this was the primary role of most of the slaves,and 'technical slaves'; to build what the government required.
As for the numbers... Well,the oft-quoted numbers are anywhere from 1 to somewhere like 30-40% with Wikipedia using an abnormally old number (one percent) from Martin Wilbur back in the 1940s. Recent estimates,taking into account all I've mentioned and the recently discovered tombs of lower-level Han officials from Fenghuangshan (Hubei) containing wooden figurines representing slaves reveal that an official would have around 40 or 50 slaves,which is startlingly huge. If we extrapolate this number to a 60 million Han population,this would mean that the slave population in Han China was hovering around a few million,far more than 1%.
I hope this just gives you a peek into the nature of the roots of Chinese slavery and how sparse this field actually is. I'd be happy to answer more specific question,such as the types of slaves the Ming had,which are slightly better chronicled or on the types of slaves of specific dynasties if you have any other questions but note that the idea of how the slave was ; Low,foreign,unworthy and functionally invisible is something that did not change in any Chinese dynasty. Individual,kind owners probably existed but,in general,China was,by all means, one of the crappier places to be a slave. As for 'who the slaves were',it varies from dynasty to dynasty though I will say that an 'exact' composition and analytical study of slaves of any dynasty in China dosen't exist,to my knowledge. Feel free to ask on something specific though!
Sources
Walter Scheidel's Slavery and forced labor in early China and the Roman world. April 2013
Andrew Forbes and David Henley's Vietnam Past and Present: The North
Wang YiTung's Slaves and other comparable social groups during the Northern Dynasties (386-618).1953
Wang YuFeng's Slavery in the United States and China: A Comparative Study of the Old South and the Han Dynasty. 1988
ME Lewis's Sanctioned violence in early China.1990.