I am always suspicious that there is a strong connection between economy and politic.
Before slaves are the only way to get things done better. So incentive to support slavery is high.
Then industrialization run high and low paid workers can get paid higher. More and more capitalists find it easier to just pay workers than enslave them. Obviously those workers want it too. Unfortunately, those workers can’t just move out. So there are bigger forces that want them to eliminate slavery. Either through democracy or through civil wars, those 2 forces fight and slavery is gone.