"The 'first theorem of welfare economics' states that private markets are perfectly efficient on their own, with no interference from government, so long as certain conditions are met... Private markets are perfectly efficient only if there are no public goods, no externalities, no monopoly buyers or sellers, no increasing returns to scale, no information problems, no transactions costs, no taxes, no common property, and no other distortions that come between the costs paid by buyers and the benefits received by sellers.
So, the market by itself demonstrably does not solve all problems. Indeed, in the environmental domain, perfectly functioning markets are the exception, rather than the rule. Governments can try to correct these market failures, for example by restricting pollutant emissions or limiting access to open-access resources. Such government interventions will not necessarily make the world better off; that is, not all public policies will pass an efficiency test. But if undertaken wisely, government interventions can improve welfare, that is, lead to greater efficiency."
As Mark Thoma writes, the aforementioned applies to all markets. As the recent experiences show, market failures are commonplace and can wreak devastating havoc. Government intervention to push them in the right direction can improve the market's performance and make us better off.