Http handler and Http module
Suppose we want to implement some logic before the page is requested we use these handlers and modules.
Best example for this is authentication.
we want to authenticate the user before he hits the page,this can be even done with out using these handlers and modules which involves lot of coding effort so we dont prefer this.
Differences between Httphandlers and Http modules
Http handlers basically work to implement some logic before hitting the page this handlers works based on the extension of file.
suppose you have .aspx and .axd extension you can use the handlers for these two different types of extension.
you can even use one http handler for multiple file extension
you have a tag <httpHandlers></httpHandlers> tag in web.config where in path you can give the extension of your file.
Http modules are event based.before your page is requested series of events are called using these http modules.