Um, the CNC machines that iPhone production uses are actually made in the US and shipped to China because the Chinese CNC machines can't handle the tolerance.
So, why is Apple shipping it there then?
Cheap labor is the answer.
And, why is Apple starting to ship production away from China?
Cheap labor is still the answer.
As we found out, the supply chains in China weren't that robust. You can put them wherever without a lot of problem and they take about 12 months to come up to speed. That's not very long at all in the manufacturing world.
Maybe a price that would allow such speed in an American company exists, but likely it's sky-high.
The Chinese one was sky-high, too. It's just that the Chinese government ate the cost.
[0] apparently they once moved 12K workers from one line to another at midnight for a last minute design change
The robots that assemble the electronic circuits are also largely built in EU. (And, of course, in Japan, too.)
What made Apple to order their iPhone production from a Chinese company was not the availability of relevant hardware elsewhere; certainly the US has it. It was the nimbleness of that company, the willingness to move fast and make things available fast. Paradoxically, less red tape and less corporate shenanigans. Cheap labor? Maybe, but it did not appear to be the major factor, and wages at Foxconn were / are not as low, by EU standards even.
And this is compared to US; in Germany, things would be even slower, to say nothing of France (which is a real industrial powerhouse nevertheless).