Modern architectures have a small number of available hardware interrupts that devices can use to interrupt the processor when they are ready to be attended to. This is very useful, if not neccessary because it aliviates the need to loop while polling devices. With interupts instead of a loop which keeps asking the keyboard if its ready until it is you can have the keyboard tell you when input is ready while your OS is doing whatever it pleases.