Capitalism as a system is built for profit. When making a profit, you want to make the best product (compared to competitors) at the cheapest price. Unfortunately the way to make this happen, especially before labor laws existed, in early capitalism, was to have cheap labor. For starters, this is why slavery was so popular. Otherwise, people would just be forced to work in terrible working conditions and live in poverty because that was better than not living at all.
Child labor: a huge outcome of early capitalism. Children would work long hours with no protections. They would often work factory jobs where they could fit into large machines to run/clean them. Thousands upon thousands of children were maimed or died.
Labor laws: created worker protections for physical, mental, and economic reasons. With these laws we see things such as unions take shape. Overall, working conditions have to be some level of decent to exist in the US.