Microeconomics begins with two fundamental laws that describe how buyers and sellers behave in a market. The law of demand states that, ceteris paribus, as the price of a good rises, the quantity demanded falls, and vice versa. The law of supply states the opposite relationship: as the price of a good rises, the quantity supplied rises, and vice versa. When these two forces meet, the market reaches its equilibrium price, the price at which the quantity demanded exactly equals the quantity supplied. The market demand curve itself is obtained by horizontally summing all individual consumers' demand curves at each price level, while the market supply curve aggregates the behavior of all producers.
While movements along a curve represent responses to the good's own price, shifts of the entire curve reflect changes in underlying conditions. The demand curve shifts when factors such as income, tastes, prices of related goods, expectations, or the number of buyers change. The supply curve shifts when input prices, technology, expectations, the number of sellers, or government policies change. A useful framework for measuring the welfare consequences of market outcomes relies on consumer surplus, the area below the demand curve and above the price, and producer surplus, the area above the supply curve and below the price. Together, total surplus is maximized at the competitive equilibrium.
Governments sometimes intervene with price controls. A price ceiling is a legal maximum price; if set below the equilibrium price, it creates a shortage because quantity demanded exceeds quantity supplied. A price floor, such as a minimum wage, is a legal minimum price; if set above equilibrium, it creates a surplus. Both types of controls typically generate deadweight loss, the reduction in total surplus that results from a market distortion, because mutually beneficial trades between buyers and sellers go unrealized.