Interesting topic. I will try to avoid going too technical and deep into windows system and OS mechanics in general, (hard to do sometimes, it's my job), and before we start it's better to state some facts just so we all understand and will be on the same page.
- Paging / Swap is a method to use a portion of a disk as RAM for when we might run applications that exceeded our total physical ram. In any case that an OS ( be that Linux, Windows, or macOS) runs out of ram, it will lead to catastrophic crashes.
- Paging/Swap file, is the file that the system will use to store temporary data that were supposed to exist on RAM.
- Modern OSes are designed around the concept of swap and actually use it very intelligently.
In the particular case of windows, apart from the use of swap when in need of extra ram, they use swap to preemptively "store" data that are not much in use but need to be ready. That includes a lot of system drivers and processes. This is ultimately a point that some modders miss as there is no real point to disable processes for the sake of ram as those processes if they are not in need by the system, they won't use ram and they will be stored in the swap. Consequentially this is also one of the reasons why a lot of programs might crash without swap.
Based on the above we understand that the swap is not used ONLY when our ram is full, but also its a way of dumbing anything that must exist in RAM space but is not needed all the time, which makes the use of swap a LOT more preferable. In reality and you can test it, your system will use more physical ram without swap and as you use more apps, it can become slower, compared to using swap and that is why it is never suggested to turn it off. The exception would be for some embedded devices which most of the time don't have hard disks (medical equipment for example), diskless workstations, etc.
I need to also say here that, when a user has multiple apps running and windows kernel detects that an app is not used often, it will send it (or parts of it) to swap anyway, regardless of the ram one has, and use the free ram for caching reasons, which in general speeds the system up. When you don't use swap, the app stays in ram but the system cant use ram for caching which tends to make the PC slower when multitasking.
Now that we know what it can do, how do we set it? Sadly the internet while it can be a great source of info, can also be a great source of misinformation. Often I run across articles on known publications that state things that don't even make sense. For example, the infamous "set the swap to be 2x-4x your ram". So I have 64 Gb ram I should have 256 GB Swap? LOL!! Doesn't make much sense right? Those are relics of the past when PCs had 1 GB of ram or less and the OS needs were exceeding the average hardware of the time. Now we have the opposite. Hardware is far more advanced than software (for the time).
A realistic scenario is simply to let windows handle the swap themselves. With the speed of the current SSDs and M.2s, you won't even feel you are using swap if that ever be the case. An argument can be made for setting swap to have small/large values the same also called static swap. That can be beneficial IF one is using a spinner disk, not really if you use an SSD. By setting a static pagefile, you may reduce seek times if the pagefile gets fragmented on spinner disks, as seek times can cause delays. SSDs Seek time is virtually zero.
For an average user, I don't see any reason why you should have more than 2-4 Gb swap file and windows will default to that too if I remember well. If you use databases or a lot of VMs or running many heavy apps concurrently, you are not an average user
and let windows handle the swap as you can never accurately know how much you will need, and if you set it manually you may risk just wasting space, or make your PC underperform.
I want to assume that most know what ram they have and also know their limitations. When you have 8Gb of ram, there is no point to run 10 Windows and Linux VMs, and swap won't save you no matter where you will set it, and it will just make the process painfully slow. When you have 16 Gb and your app recommends 32, swap will only add delay and frustration.
Hope it helped and that we have a better understanding of what swap is and does.