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).
Anthropologists have argued, in contrast, "that when something resembling barter does occur in stateless societies it is almost always between strangers." Barter occurred between strangers, not fellow villagers, and hence cannot be used to naturalistically explain the origin of money without the state. Since most people engaged in trade knew each other, exchange was fostered through the extension of credit. Marcel Mauss, author of 'The Gift', argued that the first economic contracts were to not act in one's economic self-interest, and that before money, exchange was fostered through the processes of reciprocity and redistribution, not barter. Everyday exchange relations in such societies are characterized by generalized reciprocity, or a non-calculative familial "communism" where each takes according to their needs, and gives as they have.
When barter has appeared, it wasn’t as part of a purely barter economy, and money didn’t emerge from it—rather, it emerged from money. After Rome fell, for instance, Europeans used barter as a substitute for the Roman currency people had gotten used to. “In most of the cases we know about, [barter] takes place between people who are familiar with the use of money, but for one reason or another, don’t have a lot of it around,” explains David Graeber, an anthropology professor at the London School of Economics.