The cheapest energy is from a hydroelectric plant built generations ago.
Fun fact: That's why Boeing first built their planes outside Seattle - the electricity needed to refine the aluminum was cheap.
These days, you can see that effect in the large datacenters that have sprung up near the Columbia River in Oregon.
I'd guess TSMC's siting decision had a lot to do with tax breaks, labor pool, and cheap land.