In microeconomic theory, the theory of supply and demand explains how the price and quantity of goods sold in markets are determined.
In general, where goods are traded in a market, prices of goods tend to rise when the quantity demanded exceeds the quantity supplied at that price, leading to a shortage, and conversely that prices tend to fall when quantity supplied exceeds the quantity demanded. This causes the market to approach an equilibrium point at which quantity supplied is equal to the quantity demanded. Price is thus seen as a function of supply curves and demand curves. The theory of supply and demand is important in the functioning of a market economy in that it explains the mechanism by which most resource allocation decisions are made.
The theory of supply and demand is usually developed assuming that markets are perfectly competitive. This means that there are many small buyers and sellers, each of which is unable to influence the price of the good on its own.