This is often referred to as lazy loading, as only those pages demanded by the process are swapped from secondary storage to main memory.
Contrast this to pure swapping, where all memory for a process is swapped from secondary storage to main memory when the process starts up or resumes execution.
Commonly, to achieve this process a memory management unit is used.
Entries in the memory management unit include a bit that indicates whether a page is valid or invalid.
A valid page is one that currently resides in main memory.