Market failure occurs when a free market fails to deliver an efficient allocation of resources. Merit goods are seen to be underprovided by the state whereas demerit goods are seen to be overprovided by the state. Although obviously both merit and demerit goods cause market failure by their under/over consumption, the question still lies with which causes the greater market failure, and in a personal opinion it is the demerit goods that cause the greatest market failure, this is due to the main fact that although the consumer in question may/usually is very aware of the negative impacts of the good, their consumption is not drastically reduced or stopped at all whereas where merit goods are concerned, consumers can be more easily persuaded to consume said merit product than they could to stop consuming a certain demerit product, whether that is due to persuasive incentives or just natural instinct.
A demerit good is a good which society feels is undesirable, e.g. drugs. They are overprovided by the market mechanism i.e. the public believes there should be less of the product, they are overprovided due to negative externalities or a lack of information. The government legislates against demerit goods and may choose to intervene in the market by imposing taxes on consumers and/or producers. The over consumption of demerit goods is what causes a market failure. Demerit goods produce negative externalities, in which the private costs and the external costs equal the social costs and therefore the social cost is greater than the private cost, meaning that the regular consumption of, for example, crack cocaine by an individual consumer will cost society more than it will cost said consumer personally (for example, by excessive use of the healthcare system which the public