Slavery is fundamentally a system of production.
It was humanity's attempt to create wealth long before laissez-faire capitalism was invented.
It's a very inefficient system, but it does not deserve its reputation as some sort of sadistic destruction of the slaves' dignity for its own sake.
Consider the family of the Biblical Jacob. Jacob's sons were not their father's slaves. But do you really think Reuben or Joseph could up and say to him, "Dad, I quit tending the flocks for you. I found a new job with Canaanites, Inc. in the next town. It pays more, and there is less commute. My resignation letter is attached"?
A free worker has a powerful incentive to accumulate human capital: complex skills up to and including unique creativity to use with complex capital and methods of production.
But with the economy at that primitive a stage, there was little individual use in being free, and little social benefit to free labor. Why be free when all the "jobs" out there are almost the same and unskilled? Perhaps the "security" of being a slave and a measure of a personal relationship with the master might be prized more.
This is why slavery had persisted for so long everywhere in the world. Its inefficiency was masked by the fact that free labor was not any more productive than slave labor and for that reason could not command higher incomes than slave labor.
Under capitalism, the employer spends his own money training an employee, but all the benefits accrue to the latter. The employer is particularly averse to providing training, because it makes the worker more valuable to his competitors. Thus, it happens all the time that a worker learns useful new skills at his boss's expense and then unceremoniously dumps him to get a better job elsewhere. Slavery is especially suited to act as a transitional system, because the master has a direct incentive to invest into the slave's training.
The abolition of slavery went hand-in-hand with increasing prosperity and complexity of the economy. The pressure to free the workers intensified as people came to realize the social benefits of this; as more workers were freed, this freedom itself contributed to economic improvement. The virtuous circle eventually led to the complete end of slavery as an economic institution. Slavery was destined to wither away without any violent upheavals.
It may be objected that slavery was often sustained by war, such as when the citizens of the defeated tribe or town were enslaved. However, regarding that, in a war, formerly free people are enslaved. That is a definite economic retrogression. I am arguing rather than in the ancient world, and even not-so-ancient, slavery was the default, unsurprising, and economically neutral condition of almost every worker.
It's true, there existed somewhat skilled artisans even then. But without mass production and accumulation of great amounts of capital, only very few were needed by society.
Some people are further deluded into thinking that today minimum wage jobs are a type of slavery. This is emphatically not so, because in the modern economy, minimum wage workers are upwardly mobile and are made such precisely with the help of the basic skills and work-related virtues they learn on their very temporary minimum wage jobs.
A worker's own professional growth over the course of his career, beginning perhaps indeed with washing the dishes at a fast food joint, is part and parcel of the market process itself.
Of course, no social system, including free-market capitalism, can remedy an individual's lack of natural gifts. A hopelessly dull person may indeed end up working for low wages all his life. The point, however, is again that free workers face enormous incentives to improve their skills and thus their usefulness to society, even if a few people through some disability are unable to respond to this incentive adequately.