Slavery
Slavery is the act of owning other humans (as well as other sapient beings by extrapolation) as property. As slaves were bound to their owners they were prevented from leaving or refusing to work under threat of immediate violence for disobedience. This practice in one way or another has been fairly widespread in one way or another across numerous cultures throughout recorded history. When two groups fought, the victor would capture some of the defeated along with goods and put them to work. Latter on as long distance trade improved they also began selling said captives. The children of slaves usually were slaves themselves. In other cases people would be put into slavery as a punishment, failure to pay their debts or voluntarily in a few cases to gain the favor of their superiors.
Customs and practices in regards to slavery varied from civilization based on a variety of factors. For many ancient civilizations slaves were fairly rare (less than 5% of the total population) and were typically used as domestic servants and/or concubines by the rich or doing a specific trade if they had a skill. The Greeks and especially the Romans managed to acquire a much higher than average population of slaves (as much as 50% of the Roman Population was slaves) and made use of slavery in a very broad number of fields, ranging from mine slaves who were worked to death over a few years to high ranking government officials who lived more comfortable lives than most free citizens with slave servants of their very own and everything in between. Occasionally slaves were used as soldiers such as the Ottoman Janissaries and the Egyptian Mameluks, though the fact that both of these groups of slaves managed to gain significant influence over their masters and sometimes killed them when they did not do what they wanted shows the flaw in that policy. Sometimes masters had absolute powers of life and death over their slaves while in other cases slaves had some minor legal protection. The Romans would gladly enslave anyone who resisted Roman authority too much where-as in the 16th to 19th century when the Europeans began to colonize the new world they made extensive use of slavery with a slave population imported from Africa, which led to develop the idea of Racial slavery (that black people were naturally suited to be slaves).
In addition to the practice of owning human beings as chattel there are other arrangements similar to slavery so that they are referred to as slavery informally. A few of these include Serfs (Serfs were not owned, but they were bound to the land owned by nobles and are required to work it), indentured servitude in colonial America (a guy was indentured to a contract holder and has to work for him for a term of years and the contract holder could punish said guy for failing to do work during that term), the various forced labor programs used by the Nazis and the victims of human trafficking. Comparison to slavery is often used as a rhetorical device to describe bad working conditions or precieved oppression. This ranges from the legitimate (working 12 hour shifts in a company town set up to keep you constantly in debt and not being paid real dollars for your work) to the pedantic (this 5% sales tax for iron ore shall make slaves of us all!).
Starting in the 19th century, slavery gradually declined. Serfdom however was the first to go and did so much soon there other kinds of slavery, in the west it died out around the 14th century but eastern Europe was slower and Russia held out until the 19th century. Slavery was first abolished by the Britain in 1834 and latter by other powers, despite some disagreement from those in the Southern of the US about the matter until 1861 when the matter blew up into a four year Civil War (often just called "The" Civil War since the US had only one), during the same year the Russians started to dismantle their serfdom and were the last European power to do so. Legal slavery does not exist anymore though human trafficking and illegal slavery remain a problem.
Slavery in Fantasy
Slavery is one of the common features of a setting's bad guy and an easy way to establish that a certain civilization is evil is that civilization making use of slaves. A bunch of guys attacks a place with chains and whips to take catch and take away it's people so they can be taken to toil, be beaten and raped for the benefit of some bastards is more than enough reason to establish "these guys are bad so go kill their asses". However, this is not always the case; both the perceived "good" and "bad" factions can also engage in slavery, although how they do it usually defines who's good and who's bad (regardless of how minute the difference is).
Take Araby and the Dark Elves in Warhammer Fantasy's setting, for example. Both factions engage in wanton slavery and have no qualms about it being a common thing everywhere. However, what sort of defines each of them is how they see their slaves. In Araby, slaves have several rights, the slaves of children are guaranteed by law to not be slaves and particularly cruel mistreatment of slaves will result in punishment to the masters and the mistreated becoming free. The Dark Elves consider all non-dark-elves to be beneath them, and will torture and maim their slaves just because they think it is fun.
Though it is found in both slavery is more common in fantasy settings than science fiction. Why have a bunch of slaves working in a mine when you could have a bunch of robots who don't need slave drivers, don't plot escape/rebellion, are stronger and easier to repair if damaged? Warhammer 40,000 actually justifies having slaves fairly well in that in the Imperium such automation is considered techno-heresy and the Dark Eldar are sick bastards who need to consume souls and get their rocks off at making others miserable.
Slavery of a certain kind is a common feature of many Magical Realms.