Take a box without a swap file:
500mb of ram with 5 things running. These could be plugins, IPTV player or anything else, all of this consumes 495mb leaving you 5mb
When you then make the box do something else, or the box just does something else, the thing it wants to do takes 50mb - oh crap, no room, crash. This is the extremes.
With a swap file:
500mb of ram, just the same as above but this time, the swap file kicks in.... it takes plugin one and two and puts them into the swapfile - exactly as they are in memory. It then clears the real memory. So now you might have 100mb free instead of the 5mb as above. So your new plugin, or whatever the box does has enough ram.
In short, when you need more memory, the box will SWAP the memory out to the FILE. And it will do this seamlessly.
BUT: We have cache flush now, which can be set to run silently every 5 minutes. This clears uneeded temp files and junk from the ram which free's up ram on its own. But there is no downside to creating a swap file which may not ever be used, but even with cache flush running, you could still run out of memory if you opened enough stuff within the 5 minutes.
A swap file is free and worth having on a 2S, H2S, any box with little memory. Now even a big box with lots of memory can run out if enough is running. So a swap file there still wouldn't hurt.