It would surely be a smart move to support the right partner in quickly starting a new memory factory, precisely to Apple's specifications, in return for a long-term supply agreement? If Apple could secure their memory supply and at a lower cost than all of the their PC and phone competition, it would be hugely beneficial for them.
Can't be any more entrenched than CPUs, GPUs, and broadband chips, which Apple still designs.
To be clear here, Apple doesn't actually license any cores from ARM - they've got an architectural license and implement their own cores. Licenses for cores are a different thing.
And to be clear, the foundry space for CPUs/GPUs is not the same as for RAM, which is printed with much larger feature size in order to lower the costs.
Beyond this, memory isn't produced on leading end nodes, they're a few generations back as it is. For that matter, Intel isn't even near capacity and has/had plenty of opportunity to produce VRAM and SSD Storage, they got out of both as they became more commoditized.
Production is not trivial, but can be outsourced to several parties.
If Apple had the manufacturing capabilities then sure, but they would still be running into the same resource constraints for inputs that everyone else is having nowadays.
At the moment, there are no solutions only responses.
It's a no brainer.
Immune to shortages no. They're not suffering shortages because they don't have their own design, they suffer shortages because the whole supply chain has issues, starting from required minerals and going all the way to shipping.
And like the final product (commercial RAM) now goes to AI which pays better, processes/materials/factory utilization to make RAM would continue to go to another industry and not Apple, if that pays better then.