Virtual memory allows processes to access memory addresses that exceed the amount of physical memory available. When a process references a memory page that is not in RAM, a page fault occurs which brings the missing page into memory from disk. Page replacement algorithms are used to determine which page to remove from RAM to make room for the faulting page. The working set model aims to keep the active pages used by each process in memory to reduce thrashing, which occurs when the total memory demand exceeds the available RAM.