There were five types of slaves in ancient India; those born to enslaved mothers, those purchased, those who voluntarily became slaves, e.g. to escape starvation during times of famine, those who became slaves out of fear and those captured in raids (Ja.VI,285; Vin.IV,224).
The lot of slaves was a hard one; for the smallest mistake they could be flogged, put in chains, branded or fed scraps (Ja.I451). We read of a woman severely beating her slave girl for getting up late (M.I,125).
These teachings seem to be the oldest known prohibition against slavery.
The Upāsakaśīla Sūtra (3rd cent. CE?) says a lay man should neither buy nor sell slaves nor sell his wives and children into slavery, something husbands sometimes did when in debt or during hard times.
When it was abolished in Buddhist lands, this was done by the colonial powers – in Sri Lanka in the 1820’s and in Burma, Laos and Cambodia at the end of the 19th century – and in Thailand due to pressure from Western governments in 1905.