One of the fundamental concepts in economics is that people buy and sell goods and services from each other for their mutual benefit. For instance, when you visit your favorite corner coffee bar, you're presumably happier with your coffee than you are with keeping $2.95, while the coffee-bar owner prefers your money to keeping the coffee. When you analyze transactions at this basic level, it's easier to understand the dynamics of how free trade and other economic processes work.

However, it's rare that the two parties engaged in an economic transaction are the only ones affected by it. While some market mechanisms force one or both parties to consider these effects, there are many cases in which neither party has to deal with the consequences of their actions. In these situations, others who aren't involved in the transaction must address what we call the economic externalities.

Externalities and profits
The degree of importance of particular externalities varies greatly. For instance, one mildly positive externality that results from having a bakery inside the local shopping mall is the pleasant smell of freshly baked bread. Since you don't have to buy the bread to enjoy its aroma, you benefit from the transactions of others without paying for them. From the bakery's perspective, it is providing something of at least minimal value without collecting any money from you.

However, many externalities are of much greater magnitude. A large company's decision about where to put its corporate headquarters can have a significant impact not just on the people who provide the company with land and construction work but also on the entire community. For instance, when Boeing (NYSE:BA) considered relocating its corporate headquarters away from Seattle, the city of Chicago offered it substantial tax benefits for moving there, presumably in the hopes of attracting better employment opportunities for its residents. However, the state of Washington struck back with tax incentives of its own to persuade Boeing to manufacture its new 7E7 jet. The value that local governments place on having these companies operate nearby shows the impact that externalities can have.

There are also many negative externalities from which companies in some industries benefit. The most common example is with industries that create pollution that causes health problems. Although government regulation of some pollutants has forced companies to internalize the costs of these externalities, not all polluters are regulated. Similar allegations have been posed about the health impact of secondhand cigarette smoke and the environmental impact of drilling for oil and natural gas. Many argue that by not having to take these externalities into account, companies are able to earn higher profits than they deserve.

Fixing externalities
In theory, finding a solution to the externality problem requires that the parties take into account the effects of what they're doing. As Nobel Prize winner and economist Ronald Coase theorized, assigning property rights to one of the parties gives everyone the ability to bargain for what they want. For example, there have been a number of legal cases suggesting that you don't have any property rights to the view from your home. However, if you don't want your neighbors to build a house that will obstruct your view of the surrounding area, you can offer them money to build in another way, or you can buy the entire property from them.

The problem with Coase's theorem is that some of its assumptions don't apply well to real-world situations. Often, the people affected by a particular externality can't organize well enough to bargain collectively. Sometimes, it takes just one holdout to prevent anything constructive from happening. When everyone affected can't come to a private deal, the most likely alternative remedy involves government intervention.

Companies are vulnerable
As most corporations are aware, government regulation can have disastrous effects on a company's success. With a single vote and the stroke of a pen, Congress and the President can enact legislation that can affect the basic strategic planning of entire industries. For example, the House voted last month to rescind tax breaks and impose new royalties on large oil companies. While one can argue that these companies can afford to have their record profits reduced, decisions to go forward with specific projects depend on the ability of companies to foresee their costs accurately. Imposing new and costly regulation in the middle of a project can doom it to failure.

Even if the economy doesn't require companies to take externalities into account, investors should be aware of them and their magnitude. The larger the perceived externality, the greater the chance that the government will decide to impose new regulations on companies or industries. Given the pressure on profits that regulation would create, investors must accurately gauge the probability of regulation if they want to avoid major losses. Without being aware of externalities, investors may walk headlong into an investing trap, gleefully unaware of there ever having been any danger at all.

Related articles:

Learn more important investing fundamentals with a subscription to one of our Foolish newsletters. You can try any of them free for 30 days.

Fool contributor Dan Caplinger benefits from the pleasant externalities of the simple life in western Massachusetts. He doesn't own shares of any of the companies mentioned in this article. The Fool's disclosure policy keeps everything internal.