The latency in the hardware before the signal makes it to the usb (for most keyboards, even specialised gaming keyboards this is like 30ms, which is 2 frames).
There is also the latency from when the monitor gets a signal to when the pixels have perceptually finished transitioning. This can be 10s of ms too.
So even if the OS has 0 latency, and the monitor measures that, you could still easily observe a latency of say 60ms.