FOR DECADES, China has put foreign capital to work. Officials pushed Western companies to trade technology for access to its vast market, helping build Chinese rivals that were often better and always cheaper. These upstarts began shipping goods westwards. The resulting “China shock” is often blamed for causing dislocation and despair in America’s heartlands. Now, though, it is China’s turn to worry. Its manufacturers are taking flight.