RAM prices for Apple were historically ultra expensive, already before the crisis they were charging 250 euro for 8gb.
Now it's almost the normal price. (But still expensive)
Also, their RAM are embedded in the soc package, meaning they buy the raw dies, then package them in the same block, and have a very different contract directly from the chip manufacturer (they will buy n millions of chips over n years at this fixed price)
It's not like normal PC manifacturers where they need to buy already made sticks at market price