The retail price of a product is a function of the market rate at the intersection of supply and demand. The price paid for inventory on the shelf doesn’t matter.
It works both ways. If retailers bought a lot of RAM at high prices and then the market suddenly dropped, they could have to sell it at a loss.
Some people get irrationally angry at this, but you do it too. If you bought a house for $500K and the market went up such that it was worth $700K, you wouldn’t think it was “price gouging” to list it at market rate. You’re just trading an asset for cash at the current price. The price you bought it at is irrelevant to the price you’re going to sell it for.