A swap file is a dedicated space on the drive used by an operating system to temporarily store data that cannot be held in RAM, effectively extending the system's virtual memory.