Market failure occurs when the allocation of goods and services by a free market is not efficient, often leading to a net loss of economic value. This can happen due to various reasons, such as externalities, public goods, market power, and information asymmetries, which disrupt the ideal conditions of competitive markets.