Virtual memory is a technique that allows a program to use more memory than the amount physically installed on the system. When physical memory is full, infrequently used pages are written to disk. This allows processes with memory needs greater than physical memory to run. Common page replacement algorithms are first-in, first-out (FIFO), least recently used (LRU), and optimal (OPT) which replaces the page not used for the longest time. Virtual memory provides benefits like allowing more programs to run simultaneously but has disadvantages like reduced performance and system stability.