Polling vs Interrupt: which one is first in a bare-bone piece of hardware?
Polling in hardware is quite analogous to a loop in software. Many simple devices use this method. You may have a thermostat on your wall that simply goes around and around in a loop thousands of times each second asking the same question: "Is it cold enough to turn on the heater?"

And a hardware interrupt is directly connected with a software interrupt.  Typically when we employ a hardware interrupt scheme, it directly triggers a software interrupt handling routine in the software of the controller.

Interrupts are more appropriate for things with unpredictable durations. The temperature of your room is a pretty slow changing thing, so it doesn't matter whether you ask NOW or in 10 seconds whether it is cold enough to turn on the heater.  But if you are sensing something transient, like an animal passing through an optical beam or a human pressing a button, it may be here and gone before you get around to polling it again.  For that reason, we use hardware latch and an interrupt to notify the controller that something happened, perhaps while you were doing something else or even sleeping.