The main role of prices in a market economy is to allocate scarce resources efficiently. Market failure exists when the competitive outcome of markets is not efficient (or equitable) from the point of view of the economy as a whole i.e. resources are not allocated as efficiently as they could be. This is usually because the benefits that the market provides to individuals or firms carrying out a particular activity are different from the benefits to society as a whole.