This week “The Economist explains” is given over to economics. Today’s is the first in a series of six explainers on seminal ideas.

THE idea of the price mechanism is central to the study of economics. Market prices convey information about what people want to buy and what others want to sell. Adam Smith used the metaphor of the “invisible hand” to describe how the economy is governed by price signals. In 1937 a paper published by Ronald Coase, a British economist, pointed out a flaw in this view: it did not fit what goes on within firms. When an employee switches from one division to another, for instance, he does not do so in response to higher wages, but because he is ordered to. The question posed by Coase was a profound, if awkward, one for economics. Why do firms exist?

His answer was that firms are a response to the high cost of using markets. It is often cheaper to direct tasks by fiat than to negotiate and enforce separate contracts for every last transaction. Such “exchange costs” are low in markets for uniform goods, wrote Coase, but are high in other instances. But Coase’s answer only raised further tricky questions. For instance, if the reason we have firms is to reduce transaction costs, why have market transactions at all?

To address such questions, economists have developed a theory of contracts, which makes a distinction between spot transactions and business relations that require longer-term pacts. Most transactions take place in spot markets. They are well suited to simple, low-value transactions, such as buying a newspaper or taking a taxi. And they are governed by market forces, as lots of buyers bargain over the price of similar goods. Things become trickier for goods or services that are not standardised. Parties to a transaction are then required to make commitments to each other that are costly to reverse. Take a property lease. A business that is evicted from its premises could not quickly find something similar. Equally, if a tenant suddenly quit, the landlord would be stuck. Each could threaten the other in a bid for a better rent. A long-term contract that specifies the rent, tenure and so on protects both parties from the opportunism of the other. For many business arrangements, it is difficult to set down all that is required of each party in all circumstances. This is where an “incomplete” contract has advantages. A marriage contract is of this kind. So is an employment contract. It has a few formal terms: job title, working hours, initial pay, and so on, but many of the most important duties are not written down. It cannot be enforced by the courts because its obligations are implicit. It stays in force mostly because its breakdown would hurt both parties. Because market forces are softened in such a contract, an alternative form of governance is required, which is the firm.

Coase argued that the degree to which the firm stands in for the market will vary with changing circumstances. Eighty years on, the boundary between the two might appear to be dissolving altogether. The share of self-employed contractors in the labour force has risen. The “gig economy”, exemplified by Uber drivers, is mushrooming. Yet firms are not withering away, nor are they likely to. Prior to Uber, taxi-drivers in most cities were already self-employed. Spot-like job contracts are becoming more common, but their flexibility comes at a cost. Workers have little incentive to invest in firm-specific skills, so productivity suffers. The supply chains for complex goods, such as an iPhone or an Airbus A380 superjumbo, rely on long-term contracts between firms that are “incomplete”. Coase was the first to spot an enduring truth. Economies need both the benign dictatorship of the firm and the invisible hand of the market.

Read the full brief on Coase's theory of the firm