The problem is in RAM usage of your firmwares. Nexus has a fewer "stock app" processes running in the background, thus it consumes less random access memory, so there is more of it for user apps. This means, you can launch more apps simultaneously without having some of them to be killed in the background!
Samsung tried to include as more "cool features" as possible to their devices like a pretty (and heavy) TouchWiz, much of bloatware, and all other "special" features also consume RAM.
There are several ways solving this issue:
One of them is switching to a custom ROM. Like CyanogenMod. It will really help you, but u might loose some of your phones abilities (mostly useless of them).
Another one is, you can disable all the bloatware, uninstall some unnecessary apps, that run in the background (you might have to root your ROM for some of them) disable ALL unused features like Live wallpapers, and much more. Disable some autorun apps, using 3C Toolbox (root). For more info, Google "how to free ram on" and your device name.
I strongly reccomend you to do a backup of your ROM before you begin! Otherwise, be really careful!
Good luck :)