If Apple didn't buy up the 5nm capacity, the next highest bidder would have for slightly less than Apple was willing to pay.
What makes you think Apple pays top dollars? Apple is notorious for squeezing their suppliers to save their margin and they often use their sales volume as the main leverage to gain discounts. It seems the demand for TSMC is however so high that now TSMC doesn't have to offer such incentive for large customers:
https://www.tomshardware.com/news/tmsc-is-reportedly-termina...
I don’t think it’s useful to think of it in terms of Apple needs TSMC more or the other way around. They’re both benefiting quite nicely from the cooperation.