The numbers: https://en.wikipedia.org/wiki/Manufacturing#List_of_countrie...
It's because of both.
Mature economies would do well to hold onto some basic manufacturing capacity as a matter of national security. Or at the very least, retain some of that capacity within the sphere of close and trusted allies, assuming allies of that type can even be maintained by the US at this point.