How does the Event Loop in JavaScript work?