Employers are not always very smart. It took humanity half a millennium to realise slavery is inefficient and ditch it. Go figure.
Slavery is unfortunately still a thing in too many parts of the world.
Is that why slavery was banned?
Try 7 or 8 millennia. The Atlantic slave trade was just a rounding error in all the slaves that have ever been.
Slavery wasn't inefficient and was highly profitable for slaveholders.