It *is* hard to make memory, especially HBM (...which is what the AI market wants, and is what the manufacturers are focusing on) and bringing on new capacity takes years. There's the additional wrinkle that the manufacturers we have left are the ones who survived periods where the market was glutted with oversupply in the wake of previous shortages.
These decisions play out on the order of trillions of dollars and 3+ year horizons. They're also incredibly sensitive to other geopolitical issues (Taiwan, issues with Chinese tech capability vs export/import controls, etc).
There are a lot of valid discussions to be had about how we got to this state of oligopoly: Taiwan's consistent sponsorship of its semiconductor capabilities and the subsequent concentration of technology (expertise, capacity, etc), the lack of investment/support (and ceding of technical leadership) in Western countries, the various rivalries with China and the implications of it becoming a first-class producer of semiconductors at scale, etc. None of those discussions and none of their potential outcomes can substantively change that we're going to continue in this situation (massive price increases, spotty availability, etc) for at least the next 18-24 months.
I mean lets not pretend that Apple hasn't done this for years. I had a cheesegrater Mac Pro 2019, but I had a choice with memory - I could upgrade from the base 32GB to 192GB one of two ways - pay Apple $3,000 for 160GB, or get the base 32GB model, and buy 192GB of the exact same sticks of memory (same manufacturer, timings, etc.) from OWC for $1,050. And I could sell the 32GB if I wanted.
Same with SSD. I could pay another $3,000 to Apple for 7TB of SSD (go from 1TB to 8), or I could get the 1TB, use that as a system drive, and then buy a 4xM.2 NVMe PCIe chassis, and put in 4x2TB Samsung 990 drives from Amazon and OWC for $1,100, and have 9TB of usable storage, and for bonus points, the chassis was about 400MB/s faster.