at almost any point during execution, including execution of most of the OS, an interrupt can occur that will transfer control immediately to certain points in the operating system (e.g., to a disk driver or to the scheduler).
This means that at (almost) any point during its execution, the OS must be prepared for an immediate transfer to a driver or the scheduler.
Since the code being executed just prior to the interrupt might well be OS code and hence might be using variables shared with the drivers and the scheduler, writing the OS so that it is prepared for this immediate transfer is not easy.