The basic idea about the virtual memory is that the program is combined size, data, and stack may exceed the physical memory's amount that are available for it.
You can say that the program generated addresses are called as virtual addresses and form the virtual address space.
The OS keeps those parts of the program currently in use in main memory and rest on the disk.
In multiprogramming system, virtual memory can also work with bits and pieces of many programs in memory at once. While a program is waiting for the part of itself to be brought in, it is waiting for input/output and can't run, so the central processing unit can be given to another process in the same was as in other multiprogramming system.