So, what really an event loop is?
The event queue is responsible for sending new functions to the track for processing. It uses the queue data structure to maintain the correct sequence in which all operations should be sent for execution.
Let's take an example of the setTimeout method. When a setTimeout operation is processed in the call stack, it is sent to the related Browser API which waits till the specified time to send this operation back in for processing to the event queue.
The event loop facilitates this process; it constantly checks whether or not the call stack is empty. If it is empty, new functions are added from the event queue. If it is not, then the current function call is processed.