There are a LOT of things to untangle. The first thing is the difference between leading edge fabrication, and everything else. If you look at this wiki list of active fabs (https://en.wikipedia.org/wiki/List_of_semiconductor_fabricat...), you'll see lots of plants still building stuff at 45nm+, and a large chunk building in 22-45nm.
There are only 3 main leading edge manufacturers', TSMC, Intel, and Samsung (I'm discounting Global Foundry since they publicly announced they're not chasing smaller process nodes). All of them concentration their fabs in their home country. Intel has some fabs in Ireland (I don't really know why..), Israel (Intel's Israel team is top-notch and a real contributor to Intel's success, so I guess that makes sense), and one in China (cause that's the world we live in). All of Intel's leading edge plants (10 and 7nm) are in the USA.
Of the non-leading edge plants, you'll also find that the majority of companies also concentrate their fabs in their home country, with American companies being a bit more dispersed. I would evaluate that the majority of fabs reside in a company's home country. I wager a bunch of the greater American dispersion comes from mergers/acquisitions. There's been a lot consolidation in the chip industry (at every level and vertical) in the last few decades.
I think what you're seeing isn't so much companies moving their fabs off shore. What you have is that most companies are no longer willing to invest their own R&D into pushing fabrication processes, so they stop building new fab plants, and instead look for a fabrication house to buy from. And today there's really only one choice, TSMC, which happens to be Taiwanese.
Tax
TSMC was the first company to be a "pure-play" company that did no design work and only manufactured orders. This was back in the days when the guys at Intel and IBM had the attitude that to be a real player in the industry, you had to have your own fab. But there was an increasing amount of fabless design houses in the US that would piggyback off the excess fab capacity that Intel/IBM had after they were done with their own chips, and TSMC targeted that demand by tables companies for manufacturing capacity directly.
The takeaways I got was fabs moved away from the US because TSMC and the like figured out an innovative business model that let them focus on a single part of the supply chain that provided substantial cost savings for all these new fabless companies in the US. Meanwhile, the old established players like Intel/IBM with fab experience weren't willing to hop on this new segment and kept their fab capacity mainly for making their own designs. Although TSMC started in a high capital low return segment, as opposed to fabless that could produce and capture most of the value in a chip design, the IP itself, TSMC eventually became so good at what they do and process nodes became so expensive to develop that no other US companies had the incentive to enter this segment from scratch and lose money for years before catching up with TSMC for frankly not very high returns. The only US company keeping up with TSMC is Intel, and that's because they've been manufacturing from the start and have enough volume to make investing in a fab and spreading that fixed expenditure over all their chips worth it.
There exists extremely high-tech sector called "Semiconductor Capital Equipment Industry". All the instruments and equipment involved in deposition, lithography, etch and clean, inspection, metrology, and prosess control is super expensive.
Most of that technology is in the hands of Japanese (Nikon, Canon, Hitachi High-Technologies,Tokyo Electron and too many others to name), ASML Holding is big European player and largest supplier of photolithography systems. American companies involved are Applied Materials (their Semiconductor Systems), Lam Research and KLA-Tencor.
It's a lot easier to duplicate a production chain if you have full access to the machines (which come with extensive training). And you can even copy the process on a machine-by-machine basis, which makes it much simpler.
2) Many (including myself) believe that a tightly coupled international trade is the by far most efficient way we have of avoiding violent conflict between countries.
[0] https://en.m.wikipedia.org/wiki/List_of_semiconductor_fabric...
We can filter or recycle them but it cost a lot at scale. This is an open secret in EE schools.
Taiwan government is very activist when it comes to henpecking corporations on "governance standards." Boards of a lot of important companies are de-facto micromanaged by the state.
A stark contrast to the US, where laxity on that front is negated by mindbogglingly complex securities regulations.
For US, you can still play your game, just pay enough for lawyers. For Taiwan, not so much. Choose your poison.
Western companies tend to look at the ROI as a percentage, while Chinese businessmen at the actual profit amount.
As one said, "You can't take ROI to the bank. But I can deposit my nickels."
Warren Buffett is actually pretty famous for optimizing for "free cash flow".
"Cash is King". She tought ne a lot.
Also RoI is a measure of time. Not money or profit. Time until you get your money back.
Here's a link: https://www.investopedia.com/terms/r/returnoninvestment.asp
ROI = Return on Investment. Most people in practice calculate that in excel as a percentage of profit over their capital investment.
Smart business people know there's more important things than a dimensionless number, but hey, Peter Principle and "math is hard." See Black-Scholes and the 2008 recession for how wrong that can go.
https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model
I used to do math tutoring for economics students. Boy, that was an eye-opener! I had to explain over and over what independent variables meant, and how that affected for example derivatives. As bad as p-hacking and the social sciences.
Econ Student: "Can I just plug these lists of numbers in the formula and write down the answer?"
Me: "What are the numbers measuring? Are they independent?"
Econ Student: "No idea."
https://en.m.wikipedia.org/wiki/List_of_Intel_manufacturing_...
No non-PRC company is fearless enough to build a new fab in the PRC with anything that aren’t comfortable with being copied by mainland companies.
Edit: here's some PR: https://newsroom.intel.com/editorials/intel-marks-40-years-i...
The chip inside that package was fabbed elsewhere, most probably the USA.
That makes more sense now that I think of it. Can't imagine there was a steady supply of electricity there back in the early 70s. (Got any source though?)
1. You want fabs in a country where IP laws are protected so third parties don't get their designs stolen.
2. Critical tech from a military/trade perspective.
3. Other governments don't get to introduce secret low-level artifacts such as microcode into chips which runs whole world.
4. General availability of a higher level of capital for research.
5. The confluence of talent from all over the world can contribute to state of the art advancement.
It's not even labor cost anymore.