It is not only about RAM.
Any device with different set of configuration SPECS works in sync with each other.
RAM, CPU clock frequency, Internal storage capacity & number of cores in the processor work along.
We cannot compare smartphones on the basis of only one SPEC.
Please note that,
Android devices are designed to optimally manage RAM themselves. Closing apps in the overview may improve the overall running of the device, but this has nothing to do with RAM efficiency.
And this isn't a bad thing at all. Android's automatic RAM management is the fastest and most efficient system you could wish for.
However, there are several APPS claiming to free up space from the system which is still debatable in terms of what actually happens inside the system.
Feel free to use the system at best & let us know for more queries.