Some goods will be provided by a market economy if left to itself, but they may be provided in the wrong quantity. These goods are called merit and demerit goods . The government may have to step in and intervene in the market to try to get the optimum quantity made available.
Merit goods are goods which have positive externalities.
These are spillover effects from consumption that will also benefit people other than those consuming the good. An example would be education. If people are better educated then we will become a more productive society and we all benefit. A free market will not take this into account and so may not provide enough education. If there are positive externalities in consumption, a private market will therefore tend to under-provide a good.