They bought P.A. Semi, but it was for their design capability; they never had fabs anyway, and Apple still depends on TSMC and others for manufacturing chips. Apple building fabs to ensure a guaranteed supply of memory (or logic) chips would be an unprecedented level of vertical integration, even for them.
SpaceX/xAI is investing in creating their own fab. If they can, Apple certainly can.
No RAM, no profits. Apple has vertically integrated in the past for less reason than this.
Moreover it's a massive economy of scale, while their consumer electronics competitors are busy fighting a losing battle against the server market for chips, Apple can undercut them, grow their market share and get even more service revenue.