Depending on your location this will happen for any item with a certain value and presumably risk score. It's not a unique decision they made for RAM. Probably happened to your order because the value was high enough and your location, not because it was RAM specifically
I've already been burned via amazon a few times recently.
Most recent one I bought a multi-tb hard disk, but got an old multi-gb disk shoehorned into legitimate box. Couldn't just get a replacement - had to buy one for more money since that drive's price had increased.
Its a way to make sure the delivery takes place. A code is sent to recipient and recipient only gives it to the delivery person once item is handed over. Delivery person cant mark item as 'done' without the code. I've seen Uber Eats do the same thing sometimes.
My signature on a touchpad is noticeably different from my paper signature. It’s been a real challenge for me recently as I’ve had to sign a number of paper documents while the “official” signature on file for me is an electronic one from a touch interface. A few times I have had to resubmit fresh copies when the first ones were rejected.
Sometimes I wonder if true reason behind them is not any sort of verification but to maybe increase potential punishment if caught... So effectively nothing...
This is normal for every item above ~100EUR delivered by Amazon here in Austria. Never had it happen that they asked for the code without showing me the package in-person first though.