RAM prices started climbing more than 18 months ago. Apple’s contracts are long-term but not that long-term: they probably just expired. (If you assume a 3-year contract, 18 months is how long it would take on average for a specific market shock to hit you)
Right — if we can know how long ago the contracts were agreed we can predict how much more the price will have to rise, because 20% sounds like the beginning of the problem.
That's a double edged sword. Assuming it's an 18 month contract, even when ram prices do go back to "normal" it's a year and a half until Apple has savings to pass onto to customers.