virtual memory
Imagine a tiny desk and an enormous filing cabinet. You can only work on what fits on the desk, but your project might fill a hundred folders. The trick is simple: keep only the folders you are using right now on the desk, and leave the rest in the cabinet. When you reach for a folder that is not on the desk, you fetch it, and to make room you put back one you are no longer touching. To you it feels as if the whole project is at hand, even though the desk holds only a few folders at a time. Virtual memory is exactly this trick for a running program: the desk is physical RAM, the cabinet is the disk, and the OS does the fetching and putting-back for you.
Concretely, virtual memory separates the large logical address space a program is allowed to use from the limited physical memory that actually exists. A program might be compiled to use a full 64-bit address space, far more than any machine's RAM, yet it runs fine because at any instant only the small portion it is actively touching needs to be resident in RAM. The rest sits on a backing store (a disk or SSD) and is brought in on demand and pushed out when space is tight. The hardware and OS together translate every logical address the program uses into a real physical location, or trap to the OS when the needed piece is not currently in memory.
Why it matters: virtual memory delivers three big wins. It lets a single program be larger than physical RAM (it would not run at all otherwise). It lets more programs be resident at once, because each only keeps its active parts in memory, raising the degree of multiprogramming. And it speeds startup, because a program can begin running before it is fully loaded. The honest caveat is crucial: virtual memory does not make a program run faster than if it fit in RAM — it lets it run at all. If a program's active footprint is too big for the RAM available, it can run far slower as the OS shuffles pages constantly (thrashing). Virtual memory is the grand illusion of memory management: every program is given the impression of a vast, private, contiguous memory it does not really have.
A machine has 8 GB of RAM, yet you run a video editor, a browser with 40 tabs, and a game whose total declared memory adds up to 25 GB. Everything still runs because at any moment only a few GB are actively in use; the rest lives on disk and is paged in as needed.
The sum of all programs' address spaces can far exceed physical RAM.
Virtual memory is not the same as swap space. Virtual memory is the whole illusion (logical space larger than RAM); swap space is just the disk area used to hold pages that are not currently in RAM. The illusion is built on top of paging plus a backing store, not from disk alone.