There is some strange mental block that makes it difficult for people to understand that technological progress does not and will not result in mass unemployment.
Here's a clearer example with humans instead of horses:
200 years ago, Shoemaking was one of the world's largest industries. Today, it represents a very small fraction of the world economy and almost all shoemakers have been replaced by machines.
What happened?
As shoemaking machines became commonplace, shoemakers were suddenly unable to compete. Some of them found other jobs, some of them became destitute. Most were probably able to keep shoemaking until they retired, as the shoemaking machines took a while to roll out.
However, the Shoemakers' children and other children in that generation were perfectly aware that shoemaking was no longer a viable industry. No one born after the popularization of shoemaking machines studied to become a shoemaker.
What is the result?
First, we now have less expensive, higher-quality shoes. This is not always an effect of mechanization, but it usually is. Second, we don't have mass unemployment.
Why do we not have mass unemployment? Because when you replace workers with less expensive machines, one of two things happen; either the factory owner makes more money, or shoes start to cost less. If the factory owner makes more money, they spend it on a yacht or something. If the shoes cost less, the consumers have more money to spend on food or books or whatever.
So, there are now very few people employed in the shoemaking industry, but all the shoemakers' children can now go into the expanding yacht-making or food-cooking or book-printing industries.
Recap: Mechanization does not cause long-term unemployment. At worst, it causes unemployment for a single generation of workers. Ultimately, decreasing costs in one industry contribute to the growth of other industries (either via increased profits for the wealthy or decreased costs for the non-wealthy), so there is not a significant net change in employment.