They pay TSMC loads of money to have the first chips for each process node. They were first to 5nm, they'll be first to 3nm next year too. This is because they sell whole products rather than chips like Intel and AMD, so Apple's profit margins are astronomical compared to them, and so they can afford to pay TSMC so much.