Because most believe that swapping = bad and that if you don't reduce swappiness, the system will swap when it really doesn't need to. Neither of those are really true. People associate swapping with times where their system is getting bogged down - however, it's mostly swapping because the system is getting bogged down, not the other way around. When the system swaps, it will have already factored the performance cost in to its decision to swap, and decided that not doing so would have a greater overall penalty in system performance or stability.
Overall the default settings result in good overall performance and stability. I'd recommend leaving it at the default. There are further avenues for Linux to improve its memory management to solve some edge cases, but by and large the swappiness control isn't a good workaround - adjust it in one direction and you may fix one issue and create other issues. If at all possible, simply installing more physical RAM (and leaving swappiness alone) eclipses all other remedies.
How Linux uses RAM
Any RAM that isn't being used by applications may be used as "cache". Cache is important for a fast, smooth running system, speeding up both reads and writes to disk.
If your applications increase their memory use to the point they are using almost all your RAM, your cache will shrink and on average disk operations will slow down as a result. It's not enough to have just tens of megabytes, or less, for cache nowadays.
If applications increase their memory use even further - assuming you have no swap space - you will not only have no space for cache but you will eventually run out of memory and your system will have to kill running processes. Killing processes is worse than a slow down as it gives you an unstable, unpredictable system.
How Linux uses swap
To combat both of these problems, your system can re-allocate some seldom-used application memory to the swap space on your disk, freeing RAM. The additional RAM can prevent processes dying due to running out of memory, and can reclaim a little cache so disk operations can operate more smoothly.
This re-allocation isn't done according to a definite cutoff though. You don't reach a certain percentage of allocation after which Linux starts swapping. It has a "fuzzy" algorithm. It takes a lot of things into account, which can best be described by "how much pressure is there for memory allocation". If there is a lot of "pressure" to allocate new memory, then it will increase the chances some will be swapped to make more room. If there is less "pressure" then it will decrease these chances.
Your system has a "swappiness" setting which helps you tweak how this "pressure" is calculated. It's often falsely represented as a "percentage of RAM" but it's not, it's just a value that is used as part of the formula. Values around 40 to 60 are the recommended sane values, 60 being default nowadays.
Letting your system swap when it has to is overall a very good thing, even if you have a lot of RAM. Letting your system swap if it needs to gives you peace of mind that if you ever run into a low memory situation even temporarily (while running a short process that uses a lot of memory), your system has a second chance at keeping everything running. If you go so far as to disable swapping completely, then you risk processes being killed due to not being able to allocate memory.
What is happening when the system is bogged down and swapping heavily?
Swapping is a slow and costly operation, so the system avoids it unless it calculates that the trade-off in cache performance will make up for it overall, or if it's necessary to avoid killing processes.
A lot of the time people will look at their system that is thrashing the disk heavily and using a lot of swap space and blame swapping for it. That's the wrong approach to take. If swapping ever reaches this extreme, it means that swapping is your system's attempt to deal with low memory problems, not the cause of the problem, and that without swapping your running process will just randomly die.
What about desktop systems? Don't they require a different approach?
Users of a desktop system do indeed expect the system to "feel responsive" in response to user-initiated actions such as opening an application, which is the type of action that can sometimes trigger a swap due to the increase in memory required.
One way some people try to tweak this is to reduce the swappiness parameter which can increase the system's tolerance to applications using up memory and running low on cache space.
However, this is just shifting goalposts. The first application may now load without a swap operation, but it will leave less slack for the next application that loads. The same swapping may just occur later, when you next open an application instead. In the meantime, the system performance is lower overall due to the reduced cache size. Thus, any benefit from the reduced swappiness setting may be hard to measure, reducing swapping delay at some times but causing other slow performance at other times. Reducing swappiness a little may be justified if you know what you're doing, but reducing it to as low as 10 can leave the system tolerant to very low cache sizes and leave the system more liable to have to swap at short notice.
Disabling swap completely should be avoided as you lose the added protection against out-of-memory conditions which can cause processes to crash or be killed.
The most effective remedy by far is to install more RAM if you can afford it.
Can swap be disabled on a system that has lots of RAM anyway?
If you have far more RAM than you're likely to need for applications, then you'll rarely need swap. Therefore, disabling swap probably won't make a difference in all usual circumstances. But if you have plenty of RAM, leaving swap enabled also won't have any penalty because the system doesn't swap when it doesn't need to.
The only situations in which it would make a difference would be in the unlikely situation the system finds itself running out of memory and consequently the cache system is getting hampered, and it's in this type of situation where you would want swap most. So you can safely leave swap on its normal settings for added peace of mind without it ever having a negative effect when you have plenty of memory.
But how can swap speed up my system? Doesn't swapping slow things down?
The act of transferring data from RAM to swap is a slow operation, but it's only taken when the kernel is pretty sure the overall benefit as a result of keeping a reasonable cache size will outweigh this. If your system is getting really slow as a result of disk thrashing, swap is not causing it but only trying to alleviate it.
Once data is in swap, when does it come out again?
Any given part of memory will come back out of swap as soon as it's used - read from or written to. However, typically the memory that is swapped is memory that has not been accessed in a long time and is not expected to be needed soon.
Transferring data out of swap is about as time-consuming as putting it in there. Your kernel won't remove data from it if it doesn't need to. While data is in swap and not being used, it leaves more memory for other things that are being used, and more system cache.
Are there any cases where reducing swappiness is appropriate?
Yes. If you are running a server dedicated to one particular server application that does not benefit from system cache. Some database servers such as Oracle server, MySQL/MariaDB recommend in some cases reducing swappiness to 1 to 10 as these database engines use their own caching.
Note that this is true only if your system is dedicated to that one task, and in the case of MySQL/MariaDB only if you are using purely InnoDB or XtraDB, and not MyISAM or Aria, etc. If the dedicated purpose of your system is centered around an application that does its own caching and does not benefit from system cache, lowering swappiness can be a good idea.