Explain how the JavaScript event loop handles asynchronous API calls compared to synchronous code execution.