The classic story says money grew out of barter. The butcher has spare meat, but the brewer has nothing he wants, so people settled on metal that keeps and divides easily. No society that ran on barter before money has been found. Early economies ran on credit, favors, and gifts.
From The Wealth of Nations by Adam Smith