“Everybody believed that China would always be cheaper,” said Harold L. Sirkin, a senior partner at Boston Consulting. “But things are changing even faster than anyone imagined.”

Rising costs in China are causing a shift of some types of manufacturing to lower-cost countries like Bangladesh, India and Vietnam. In many cases, the exodus has been led by the Chinese themselves, who have aggressively moved to set up manufacturing bases elsewhere.

In recent years, the United States has started to get more attention from that exodus. From 2000 to 2014, Chinese companies invested $46 billion on new projects and acquisitions in the United States, much of it in the last five years, according to a report published in May by the Rhodium Group, a New York research firm.

The Carolinas are now home to at least 20 Chinese manufacturers, including Keer and Sun Fiber, which set up a polyester fiber plant in Richburg, S.C., last year. And in Lancaster County, negotiations are underway with two more textile companies, from Taiwan and the Chinese mainland.

“I never thought the Chinese would be the ones bringing textile jobs back,” said Keith Tunnell, president of the Lancaster County Economic Development Corporation, who helped put together subsidies for Keer estimated at about $20 million, including infrastructure grants, revenue bonds and tax credits.

The inner workings of Keer’s factory in Lancaster County help demonstrate why yarn can now be produced for such a low cost in the United States and point to the kind of capital-intensive manufacturing that could thrive again in America.

Inside the 230,000-square-foot spinning plant, giant machines help clean the seeds and dirt from the cotton and send the fluff into carding machines that assemble the cotton into thick, long ropes of fiber. Workers then feed the ropes into machines that spin the cotton into spools of yarn or thread.