It's a big thing in the prelim course, where we look at it as more than related to the environment.
This is from my revision prelim notes, hope it helps to some extent:
Market failure is when the market fails to take into account the social costs of production as well as the private costs. In general this could be cause there is a negative externality (e.g. pollution) however it could also be when the market fails to take into account a positive externality (e.g. benefits arising from education)
^This diagram shows a negative externality
Also these are some of the government intervention strategies as a result of market failure:
Problem: Government Action - Outcome
Market Price to high: Price ceiling - Reduces price, quantity shortage (disequilbrium)
Market price to low: Price floor - Increase price, quantity excess (disequilibirum)
Market quantity too high (negative externalities): Taxes - Increase equilibrium price, reduces equilibrium quantity
Market quantity too low (positive externalities): Subsides - Reduces equilibrium price, increases equilibrium quantity
Market does not provide a good or service (public goods): Government provides good or service - Government must collect taxation revenue to finance its supply of public goods