Theory

The potential effect of
government policy on resource misallocation is illustrated below in
Figure 1. At first it is shown in the right that consumers obtain
welfare (measured by the green rectangular in the right) from consuming
a commodity X produced through market mechanism. (e.g. commodity that generates negative externalities). However, inefficiency
or welfare loss arises because these resources used to produce
commodity X could be used to produce another good Y that would generate
much more welfare for consumers (measured by the green rectangular in
the left).
The difference between welfare gains from two goods measures inefficiency or welfare loss of market economy that does not produce commodity Y, or efficiency gain or welfare gain from the intervention by government who whether produces commodity Y or creates incentives for private sector to produce commodity Y.
An important aspect to
understand is that the welfare loss in the right side of the figure
arises from inefficient allocation of resources (land, labor, capital).
This is why economists say that the role of government here is to
improve the allocation of resources - the allocation function.

Figure 1. Welfare gain from government policy
Source: Compiled by the author