Apple already had giant margins before and could easily absorb memory price increases. The fact that they did not and instead decided to increase prices shows how confident they are that people will buy their hardware anyway.
Apple has long term contracts for every part that goes in the most complex supply chain on the planet. Do you think they call their suppliers every morning asking for 2 million chips?
Their price increases were a mixture of absorbing some of the increase and passing what they won't on us.