The US could do the exact same. Many high-quality, sophisticated goods are made in the US.
It's just cheaper to do in China because the salaries are lower and the costs of establishing more efficient business infrastructure are lower.
And since these companies care more about cost than anything, they choose China.