We can talk about wages and employment rates, and race all day long, but those are just details. It's human greed in the end, and our inability to love others like we love ourselves.
The factory owners largely didn't care and caused quite a few large scale accidents facing little to no consequence for it.
That only changed in Europe after strikes, unions and socialist programs got punched through (also stuff like the 48 hour work week, 2 days of rest a week, sickdays, social welfare and healthcare and a lot of other stuff that was largely not capitalistic in nature), in the US only after anti-monopoly rulings where deployed en masse (while still paying out the factory owners shitloads of money).
That isn't capitalism.
> In later stages it actually did keep those people there because they either couldn't afford to leave the city without half the family starving
I'm not sure what that means. Cities weren't that big. Just walk out and go live on some uninhabited BLM land if you don't want to participate in the capitalist economy.