We already know that a person named primary memory executes a computer program and another person named secondary memory stores the program.
But who the heck is Virtual Memory?!
He is an illusionist who gives programmers an illusion to think that there is a large main memory ( RAM, ROM ) but reality hits hard like you have been hit while understanding its concept firstly.
Actually, computer has a relatively small main memory. Each memory address that is referenced by the CPU goes through a mapping from virtual address to a physical address in main memory.
A virtual memory system provides a mechanism for translating program-generated address into correct main memory locations. This is done dynamically that's why programmers get illusion of having large main memory.