Barter is a system of exchange by which goods or services are directly exchanged for other goods or services without using a medium of exchange, such as money. It is distinguishable from gift economies in that the reciprocal exchange is immediate and not delayed in time. It is usually bilateral, but may be multilateral (i.e., mediated through barter organizations) and usually exists parallel to monetary systems in most developed countries, though to a very limited extent. Barter usually replaces money as the method of exchange in times of monetary crisis, such as when the currency may be either unstable (e.g., hyperinflation or deflationary spiral) or simply unavailable for conducting commerce.
As Orlove noted, barter may occur in commercial economies, usually during periods of monetary crisis. During such a crisis, currency may be in short supply, or highly devalued through hyperinflation. In such cases, money ceases to be the universal medium of exchange or standard of value. Money may be in such short supply that it becomes an item of barter itself rather than the means of exchange. Barter may also occur when people cannot afford to keep money (as when hyperinflation quickly devalues it).
When exchanging services, it’s important to remember that bartering is considered income. While you may be able to write off expenses you incur during the barter, you must claim the fair market value of the services you provided as income. For example, if you charge $60 an hour as a massage therapist, and you trade a one-hour massage for housecleaning services, you may have to claim the equivalent income. When you trade assets, you may even be responsible for tracking capital gains or losses. If you have any doubts or questions, consult the IRS website.
No academics I talked to were aware of any evidence that barter was actually the precursor to money, despite the story’s prevalence in economics textbooks and the public’s consciousness. Some argue that no one ever believed barter was real to begin with—the idea was a crude model used to simplify the context of modern economic systems, not a real theory about past ones.