Final answer:
An externality affects third parties not involved in an economic activity, causing market failures when social costs (negative externalities) or benefits (positive externalities) aren't accounted for, leading to overproduction or underproduction respectively.
Step-by-step explanation:
An externality is a consequence of an economic activity experienced by unrelated third parties; it can be positive or negative but is not reflected in the cost of the goods or services involved. Externalities can lead to market failures where the full social costs or benefits of production and consumption are not reflected in market prices. Particularly, when negative externalities are present, such as pollution, the market quantity of a good produced exceeds the socially optimal level because the supply curve fails to include all social costs of production, leading to overproduction relative to what would be socially beneficial.
Examples of negative externalities include pollution from a factory that affects the health of nearby residents or noise from an airport that disrupts the surrounding community. Conversely, positive externalities could involve situations like education, where people who are educated contribute to the economy's productivity, benefiting others who did not pay for their education, or someone's decision to get vaccinated, which contributes to herd immunity.