When RAM capacity is at its limit, a portion of HDD/SSD space is used to store volatile data. Swap should almost never be used as it is slow and can cause excessive hard drive usage known as disk thrashing. Just get more RAM
Process
- A new process wants to load, but there is not enough free RAM for it
- A offscreen process(es) are unloaded from RAM and copied into a Page File saved to the hard drive
- When you need the offscreen process(es) they are loaded into memory quickly, then unloaded, then reloaded. This is the swap