What exactly determine how Azure Functions operates as a serverless, event-driven compute service that allows you to execute small pieces of code without managing any infrastructure? Furthermore, this platform automatically scales based on demand and ensures that you only pay for the exact resources your code consumes during its execution. How does the ability to trigger code from diverse sources like HTTP requests, database changes, or message queues make it an essential tool for building modern, scalable applications?