There are times when the market fails to provide a necessary good or service, or fails to properly assign costs. Economists refer to this as a market failure. Public goods, positive externalities, and negative externalities are three forms of market failure. Government has the capacity to step in and deal with these market failures in a variety of ways.
There are times when the market does not provide a good or service that people want. If a good is nonrival and nonexcludable, the free market will probably not provide it. A good or service is nonrival when one person's consumption of the good or service does not diminish another's consumption of the good or service. For example, when you go to the movie theater, the presence of another person does not diminish your ability to consume the service, unless of course he has a screaming infant in his lap. A candy bar is an example of a rival good. If you eat the candy bar, then another consumer cannot. A good is excludable if the producer can withhold it from those unwilling to pay for it. Public highways are an example of a nonrival, nonexcludable good. A private firm has little incentive to produce a public highway at its own cost. Therefore, it is up to government to provide these types of goods.
Public goods and services include such things as roads, bridges, police protection, fire protection, national defense, and public education. Although private enterprise benefits from the presence of these public goods, individual firms have little incentive to provide them. Wal-Mart may benefit from the presence of Interstate Highway 35 as a means of transport, but Wal-Mart is not about to build a highway from Laredo, Texas, to Duluth, Minnesota. Why? IH35 is nonrival and nonexcludable. As such, Wal-Mart would find it next to impossible to profit by owning it.
Sometimes the production of a good or service creates a spillover benefit for someone who is neither the producer nor the consumer, called a positive externality. Assume you live in a typical American neighborhood. If your neighbors were to landscape and remodel their home in such a way that significantly increased its value, you also would benefit. Your home would also appreciate in value, but you paid nothing for the increase. Flu vaccines create a positive externality as well. If you're concerned about catching the flu, you would go to your doctor and pay for a flu shot. Your decision to get a flu shot creates spillover benefits for the people around you. Your immunity reduces the chance that they will contract the disease even though they did not pay for it. Economists refer to these people as freeriders.
Some economists argue that subsidized loans and grants for college students are part of the problem, not the cure. The financial aid system, while well-intentioned, has the effect of increasing demand for college. As you know, increased demand leads to higher prices.
When production of a good or service creates a positive externality, there is never enough of it. In order to increase the desirable good or service, government might choose to subsidize its production. Government subsidizes public schools for this reason. Even though private schools exist, there are not enough private schools to educate the population. An educated population creates a positive externality, so government subsidizes education for all children. Businesses in America do not have to teach their workers to read the employee manual or compute math problems.
Negative externalities occur when the production or consumption of a good or service creates spillover costs to society. Pollution is an example of a negative externality of the production process. For example, a shoe manufacturer produces shoes, but it also produces air pollution that is released outside the factory. When the firm sells the shoes to its customers, the cost of the pollution is not factored into the price of the shoes. People living near the factory bear part of the cost of production in the form of pollution but do not receive payment for the shoes that the factory makes. When a firm's production creates a negative externality, there is too much of the good being produced. In a situation like this, government can tax the producer to reduce the amount of shoes, and pollution, produced.