PJD1 beat me to it. RAM runs the operating system. Whereas SD cards (memory) stores all your data i.e. apps, photo's, videos, music, chats, messages etc etc. So if you are a heavy user of media etc, the greater the memory the better,. Memory has become cheap, probably all phones now have a slot for micro SD cards, 64 Gb or 128 Gb cards are common. Some people are confusing ROM and memory I think.
You don't need massive amounts of RAM for the phone to operate correctly, 1 or 2 Gb is typical, and is fixed. It's soldered to the circuit board of the phone, you cannot upgrade it... Higher end phones now boast 4 or even 8 Gb of RAM, but unless you have dozens of apps open at the same time, doing a lot of multitasking or run complex memory intensive games (who does that?), the extra RAM and cost is wasted. The average user who just wants a phone to use as a phone, sending messages and a bit of surfing or streaming audio doesn't need large amounts of RAM...