Virtual memory uses demand paging to improve memory usage by only loading pages from disk into RAM when needed by the CPU. This allows programs to be larger than physical RAM since unused pages remain on disk. When a program accesses a page not in RAM, a page fault occurs and the OS loads the required page from disk transparently. Demand paging allows more efficient use of physical RAM and faster program startup compared to loading the entire program at once.