It goes both ways. Who is TSMC selling this excess capacity to? Who is selling hundreds of millions of devices?
Also, there are other ways to lower costs. Apple could've just overclocked an existing 5nm chip and not talked about it.
It goes without saying a $50 increase is nontrivial to any production cost.
TSMC doesn't build N4 capacity unless there is contracted demand. Apple would have agreed to a price increase before TSMC built the lines.
You can't simply overclock a chip. Each of the blocks on the SoC are hand tuned for a certain target frequency. That's how Apple achieves great power efficiency. If you overclock, power and voltage will go up much faster than the clock.
$50 isn't trivial, but at the same time, Apple doesn't adjust prices annually. There is no way iPhone X and iPhone 14 Pro have the same materials cost even though both are $999.