ASML supplies the machines, TSMC builds the infrastructure around them to maximize yields/make the investment profitable. Both of them have built complementary IP that is nearly impossible to replicate without violating multiple patents and spending 10s of billions of dollars.
In case any readers are (like I was) torn on the question of whether such a patent based legal monopoly (or duopoly or oligopoly...) is justifiable compensation for the resources these companies undoubtedly invested, check out this short intro to a highly recommended book that deals with this issue:
That’s a great reference. A number of mainland countries were only able to catch up to Britain in industrialisation by suspending patent law for a while. Looking back I think it’s obvious that the result of this was hugely positive.
This also makes me somewhat sympathetic towards the lack of ip protections in China and other developing economies. Too often the patent system is used to kick away the ladder once one party has gained an advantage.
Still even without the patents. The knowledge and know how is incredibly hard to replicate. China doesn't even respect patents and they can't fully replicate the associated tech.