But once the factories have absorbed all these desperate farmers, they need to find a new competitive advantage. That usually involves making better products. When the T-shirt phase ends, a “race to the top” usually begins. Factories often shift to finer clothes, like dress shirts, which require skilled workers. This phase often involves the growth of unions and rising wages. It’s typically followed by one in which factory owners, forced to pay more, seek out ever more profitable lines of business. That can mean the move to low-end electronics assembly, then auto plants and maybe even airplane manufacturing. At the high end of the spectrum, you begin to see what the U.S. manufacturing economy is going through now — expensive products, like medical devices, which are often made by machines that are operated by highly skilled workers.

Bangladesh is in that moment when the race to the bottom coincides with the beginning of a race to the top. Munir Quddus, dean of the business school at Prairie View A&M University in Texas, remembers living as a teenager in Bangladesh, in the ’70s, when it was one of the poorest countries on earth. Since the arrival of textile manufacturing, in the late 1970s, the country’s poverty rate has fallen to less than 40 percent from 70. The average Bangladeshi went from living on about $1 a day to more than $5. But while there have been modest improvements in some factories (“They have air-conditioning,” Quddus says), there are still thousands of decrepit ones with minimal oversight. Quddus also points out that roughly 10 percent of Parliament seats are occupied by factory owners, and others have strong political ties. This includes Sohel Rana, the owner of the factory building that recently collapsed.

Bangladesh has become the world’s second-largest apparel exporter, growing from next to nothing to $18 billion a year. “It could be a $40 or $50 billion superpower,” Quddus told me. That will require a coordinated race to the top. The government would have to support factory inspections and safer conditions, which would inevitably raise prices — and could send wholesalers elsewhere. Cambodia responded to angry worker strikes by raising its minimum wage to $78 a month, about double of that in Bangladesh. The average Cambodian T-shirt now costs an American wholesaler around $2.50, which is 82 cents more than one coming from Bangladesh — a huge differential in the apparel trade. Mike Flanagan, a retail-sourcing consultant, told me that if Bangladesh raised its prices even 50 cents, the results would be devastating. “There won’t be four million garment-making jobs in Bangladesh,” he wrote in an e-mail. “There probably won’t be 4,000.”

Many in Bangladesh fear that if the country becomes too expensive a place to make clothes, countless sewing machines will be sent to new factories in Nigeria, Kenya or Ghana. But Vijaya Ramachandran, an economist at the Center for Global Development, who recently studied the industrial prospects of sub-Saharan nations, says this outcome is unlikely. African countries may have a steady supply of unskilled labor, but a higher cost of living should keep them from competing with Bangladesh.