How event handlers use callstack?

Could anyone tell me? How event handling functions are put on the callstack?

My guess:
I think they’re are not put in the callback queue of the event loop like setTimeout’s callback function. As I’ve seen that event handling functions get executed the moment an event occurs doesn’t matter if your code has finished executing or not…

Appreciate your share of knowledge for better understanding.