David Graeber, in Debt: The First 5,000 Years, explains how money came about in human societies and how different the facts are from conventional accounts of it in economic textbooks (that money arose as the natural next stage of the barter system).
1) Adam Smith first proposed in ‘The Wealth of Nations’ that as soon as a division of labor appeared in human society, some specializing in hunting, for instance, others making arrowheads, people would begin swapping goods with one another (6 arrowheads for a beaver pelt, for instance.) This habit, though, would logically lead to a problem economists have since dubbed the ‘double coincidence of wants’ problem—for exchange to be possible, both sides have to have something the other is willing to accept in trade. This was assumed to eventually lead to the people stockpiling items deemed likely to be generally desirable, which would thus become ever more desirable for that reason, and eventually, become money. Barter thus gave birth to money, and money, eventually, to credit.
2) 19th century economists such as Stanley Jevons and Carl Menger  kept the basic framework of Smith’s argument, but developed hypothetical models of just how money might emerge from such a situation. All assumed that in all communities without money, economic life could only have taken the form of barter. Menger even spoke of members of such communities “taking their goods to market”—presuming marketplaces where a wide variety of products were available but they were simply swapped directly, in whatever way people felt advantageous.
3) Anthropologists gradually fanned out into the world and began directly observing how economies where money was not used (or anyway, not used for everyday transactions) actually worked. What they discovered was an at first bewildering variety of arrangements, ranging from competitive gift-giving to communal stockpiling to places where economic relations centered on neighbors trying to guess each other’s dreams. What they never found was any place, anywhere, where economic relations between members of community took the form economists predicted: “I’ll give you twenty chickens for that cow.” Hence in the definitive anthropological work on the subject, Cambridge anthropology professor Caroline Humphrey concludes, “No example of a barter economy, pure and simple, has ever been described, let alone the emergence from it of money; all available ethnography suggests that there never has been such a thing.”