I always thought of it as the other way around. Industrial and agricultural machinery was ultimately cheaper than owning slaves to do the same work. The industrial revolution happened, and slaves were no longer economical. The same goes for draft animals, too.