Roughly 100 miles of open ocean separates the Chinese mainland from Taiwan. It may as well be 10,000 miles. The difference is the same. That is an absolutely uncrossable gap for the Chinese military. Taiwan has a standing army of 150K+ and a million+ reservists. I've seen estimates that China would need to land half a million troops to invade and occupy Taiwan, minimum. China simply does not have that amphibious capability.
Beyond the direct military capability, you need supply lines. The logistical effort is so easily disrupted.
On a clear day, you can see the white cliffs of Dover from Calais in France yet for 5+ years the German Army, being millions strong, was completley incapable of crossing that gap of roughly 17 miles. It took the Allies years to muster the logistics necessary to invade Europe and it really took bad strategy by the Germans to allow that to happen (eg the whole Fortress Europa effort was silly and a complete waste of manpower). A wide enough river is sufficient barrier to stop even a modern army.
Could China lob missiles at Taiwan? Sure, but to what end? Could they institute a naval blockade of Taiwan? Absolutely. But again, to what end? The American State Department will tell you it's because China is the Big Bad, the USSR 2.0. But just like with the USSR< the US likes to have an ideological foe to distract ordinary people from the fact that they're getting fleeced by the wealthy.
It's worth adding that the official policy of the US government is the One China policy [1]. The US isn't actually interested in an independent Taiwan.
So let's stop talking aobut invading Taiwan like it's a thing that's going to happen.
What I suspect TSMC is doing here is hedging against a tarde war, diversifying their production and ingratiating itself with the US for when things like chip fabs become a sufficient national security interest that the US actually wants domestic supply and/or starts restricting what can be exported to Taiwan.
[1]: https://www.brookings.edu/articles/understanding-the-one-chi...