TSMC gave Samsung this opening. TSMC was strictly better all the way from 14nm until recently.
The first wave of 3nm kind of sucks and it shows up in the mediocre improvements generation over generation for the Iphone 15. First-gen 3nm has terrible yields too.
There's a reason Intel exited in the first place. Had they been successful, it would've been a business worth tens of billions of dollars. They exited and Apple wanted to try because the money to buy the business for Apple is chump change.
They could even acquire TSMC if push came to shove. Their large cash holdings gives Apple so much strategic leverage.