The price mechanism is remarkably good at matching what people want with what gets produced. It is also, in specific and predictable situations, badly wrong. A factory that pollutes a river faces no bill for the damage, so it pollutes more than it should. That gap between what a market produces and what society would want it to produce is market failure.
Market failure
A situation where the market mechanism allocates resources inefficiently, producing too much or too little of a good.
Market failure does not mean the market has collapsed or that firms are losing money. It means resources are misallocated. Candidates who define it as a market that has stopped working almost never gain the mark.
Externalities
An externality is a cost or benefit that falls on someone who is neither the buyer nor the seller. Because that third party has no say in the transaction, their gain or loss never enters the price, and the market therefore misjudges how much to produce. Negative externalities, such as pollution or traffic congestion, mean the good is over-produced. Positive externalities, such as vaccination or education, mean it is under-produced.
The phrase examiners are looking for is 'third party'. A cost the firm itself pays is a private cost, not an external one. Naming a specific example, such as noise affecting residents near an airport, converts a definition mark into a full answer.
Two related categories often appear alongside externalities. Merit goods, such as healthcare and education, are under-consumed because people underestimate the benefit to themselves. Demerit goods, such as tobacco, are over-consumed because people underestimate the harm. Both stem from imperfect information rather than from third-party effects, which is a distinction worth keeping clear. Public goods, such as street lighting and national defence, are non-rival and non-excludable, so nobody can be made to pay and the market provides none at all.
Why does a free market under-provide public goods?