How does the HttpApplicationFactory in ASP.Net work?

The steps performed by the HttpApplicationFactory can be summarized as follow:
- The HttpApplicationFactory class maintains a pool of HttpApplication objects and uses them to service requests for the application. The pool has the same duration of the application's lifetime.
- When the first request for the application arrives, the factory class extracts information about the type of the application (the global.asax class), creates the application state and fires the Application_OnStart event. 
- The factory selects a HttpApplication instance from the pool and assigns it to process the request. If no objects are available, a new HttpApplication object is created.
- The HttpApplication begins processing the request and won't be available for new requests until the request completes. If new requests for the same resource come in, they will be handled by other objects in the pool. 
- The application object gives all registered HTTP modules a chance to preprocess the request and figures out what type of handler can best handle the request. It does this by looking at the extension of the requested URL as well as the information in the configuration file.