In multiprogramming environments, physical memory is a constrained resource. Swapping provides a solution by temporarily moving idle or blocked processes from main memory to a backing store (e.g., disk), and later reloading them for execution. This allows the operating system (OS) to create the illusion of a larger logical memory space.
In practice, modern systems implement suspending swapping: they page normally, but when memory is exhausted, they swap out entire processes (often the least recently used one). 9.5.6 Swapping