The CPU hardware has a wire called the interrupt-request line that the CPU senses after executing every instruction. When the CPU detects that a controller has asserted a signal on the interrupt-request line, it reads the interrupt number and jumps to the interrupt-handler routine by using that interrupt number as an index into the interrupt vector. It then starts execution at the address associated with that index. The interrupt handler saves any state it will be changing during its operation, determines the cause of the interrupt, performs the necessary processing, performs a state restore, and executes a return_from_interrupt instruction to return the CPU to the execution state prior to the interrupt.
The CPU constantly checks the interrupt-request line after each instruction. When a device signals, the CPU uses the interrupt number to find the correct service routine from the interrupt vector. The handler then saves state, processes the request, restores state, and returns control so the program continues as if nothing happened.