Market power and externalities are examples of a general phenomenon called market failure—the inability of some unregulated markets to allocate resources efficiently. When markets fail, public policy can potentially remedy the problem and increase economic efficiency. Microeconomists devote much effort to studying when market failure is likely and what sorts of policies are best at correcting market failures. As you continue your study of economics, you will see that the tools of welfare economics developed here are readily adapted to that endeavor. Despite the possibility of market failure, the invisible hand of the marketplace is extraordinarily important.
p. 150 - Principles of Economics (2015) - Ch. 7. Consumers, Producers, and the Efficiency of Markets