When the market fails to allocate resources efficiently, such as with public goods, common goods, and externalities.