Martin has much of it right.
The problem is that there was a shortage of labour in the new world. This was true in the 1800’s, and it was doubly true in the 1600’s when slavery started. Every time new territories opened up, there was land for the taking. Restless workers would up and leave for open fields. Hey, a lot of them moved there from Europe, what’s a few hundred miles by foot or wagon? In a scarcity economy, wages were pretty good (relatively).
Then, as mentioned, picking cotton was hard work. Particularly, it was hard work for white people, who were likely to get sun burn if out in the fields all day every day. So it may have been cheap to hire help, but it would not have been cheap to hire Europeans who had a choice to work in the cotton fields.
Another problem was the locals. Not only did the natives who were around at first tend to die off from European sicknesses, but they also tended to die rather than work. There’s a particular mentality of hunter-gatherers… They don’t work day in day out but will go looking for food when it’s needed; they wait for the weather; they wait for right time. I read a far more eloquent explanation, but basically agricultural cultures (such as the west Africans) know they have to work all the time, don’t put it off. Basically, the natives would often die rather than work (Columbus and his successors resorted to torture and mutilation to force cooperation) while Africans would work with a little application of the whip. Add to that, they were adapted to the semi-tropical climate, and they were a labour source waiting to happen. The coastal Africans were delighted to trade their interior neighbours for a little spending money.
The trouble with using slaves for more complex tasks is that they are more complex. A bag of cotton, or stacks of sugar cane, are very simple products to eyeball in terms of quantity and quality control. Not so in an industrial factory. Machinery needs semi-skilled maintenance. A person misfeeding material can do a whole lot of expensive damage to your raw input - and so on. When the industrial revolution came to America, it was a self-feeding phenomenon that went where there were people able to work for it. The north where there had already been more work for free men had the workforce to feed the mills.
You have only to read the horror stories of early British industrialization - i.e. children horribly malformed by hard work by age 20 - to realize bad as things were, they were nowhere near as bad in the USA where the workforce had options on the frontier.
(The north also had a lot more of what the early industrial revolution needed - coal. )
If you remember your history lessons, Eli Whitney invented the cotton gin, which sped up the process of cleaning the picked cotton tremendously (and so made processed cotton cheaper). This made cotton an excellent and in demand material for (British) textile mills as the textile phase of industrialization took off. What was a lesser plantation economy became the big money maker that also displaced other economic development to dominate the south. Richer plantation owners could bid up the price of slaves.
That was, IIRC, one argument against abolition; slaves were valuable and so treated well. Django or Mandingo notwithstanding, most slaves lived a pretty good life and were well treated (considering their position). However, as the abolitionists pointed out, owner could and sometimes did abuse or kill slaves. The fact that “it only happened occasionally” did not mitigate the basic insult to human dignity that slavery was.
The result was that for undesirable work, slavery was a lot cheaper than hiring scarce labour. Based on the millions of slaves and the few thousand that ran away each year, it appears that the cost of the slave retrieval and control was not a significant drain. Plus, the whole countryside was arranged to make successful escape difficult. Slaves could not easily “blend in”.
After the civil war, a lot of ex-slaves migrated to the northern cities to find work that was not available down south - this is likely what would have happened if the plantation had tried hiring instead of slavery. A decade of war and emancipation basically destroyed the cotton industry for a while.
I’m not up on what happened in the Caribbean or Brazil, but I assume once the British took it upon themselves to interdict the slave trade in the 1830’s, the value of healthy, living slaves went up quite a bit and they were treated better.