Very simply (or maybe not 😛):
Windows uses a virtual memory model, i.e. all programs are able to access the full memory address space (e.g. 4GB) regardless of how much physical memory you actually have. That is, every program thinks it has 4GB of RAM all to itself.
Windows does this by dividing both virtual and physical memory into pages of a certain size. Pages may be in physical memory or in the page file on your hard drive. When a program accesses something in (virtual) page 12345, for example, Windows checks to see if the page is in physical memory. If it is, then all is good.
If the page is not in physical memory, then it must be swapped in from your page file. If Windows finds an unused frame in physical memory, then it can just stick page 12345 in there. If there are no unused frames of physical memory, then Windows will move the contents of a physical frame to the page file and then stick page 12345 in its old spot.
This is a basic explanation of virtual memory. Windows does swap stuff to your page file even if there is space in physical memory.