a context switch
Imagine one chef cooking several dishes by rotating among them. To leave a dish and pick up another without ruining either, the chef must note exactly where each one was (heat level, timer, what is half-done) and restore that state when returning. A context switch is the OS doing this for processes: saving everything about the currently running process and loading everything about the next one, so the CPU can switch from running one to running another.
Step by step, when the OS decides to switch (because a time slice ended, an interrupt arrived, or the running process blocked), it saves the running process's context, its CPU registers and program counter, into that process's PCB; it then selects the next process and loads its saved context from its PCB back into the CPU registers, updates memory-management state (such as the page-table pointer) to that process's address space, and resumes execution at that process's saved program counter. The departing process freezes mid-stride; the arriving one thaws exactly where it left off.
Context switches are what make multitasking on a single CPU possible: by switching fast enough, the OS gives the illusion that many processes run at once. But they are not free. The save-and-restore work is pure overhead (no user computation happens during it), and switching to a different address space can flush caches and the TLB, so the new process starts cold and runs slower for a moment. This is why switching too often hurts throughput, and why distinguishing useful work from switching overhead matters. Note that switching between threads of the same process is cheaper, since they share an address space.
A timer interrupt fires while process A runs. The OS saves A's registers into A's PCB, loads B's registers from B's PCB, and B resumes. The few microseconds spent saving and restoring did no useful work; that is the switch's overhead.
Save A, load B: the time spent is overhead, not computation.
Context switching is overhead, not progress. Switching too frequently (or to a cold address space that flushes the TLB and caches) can hurt overall throughput.