Swap is also used to offload data in RAM that’s used infrequently to instead prioritise caching data that doesn’t need to be in RAM but is nevertheless used more frequently.
If you’re playing Dark Souls and have a web browser open in the background, each time you die the game may need to re-load some level data or assets from disk (e.g. they relate to the area you respawn in, but not where you keep dying). If the computer can instead keep those in RAM, you can respawn faster. If it has to put Chrome on disk that may be a worthwhile tradeoff.
Swap is also used to offload data in RAM that’s used infrequently to instead prioritise caching data that doesn’t need to be in RAM but is nevertheless used more frequently.
If you’re playing Dark Souls and have a web browser open in the background, each time you die the game may need to re-load some level data or assets from disk (e.g. they relate to the area you respawn in, but not where you keep dying). If the computer can instead keep those in RAM, you can respawn faster. If it has to put Chrome on disk that may be a worthwhile tradeoff.