All societies are capable of producing surpluses of use values. Some societies exchange surplus use values(at first as gifts, later as gifts expecting gifts of similar quantity or quality back.).
From the regular exchange of gifts arises the commodity form and hence commodity-value and exchange-value. From the emergence of the commodity form, there arises the possibility of creating a use-value for the sole purpose of exchanging it with someone else's; i.e. commodity production and circulation arises.
Consequently, one begins to look at a big pile of rocks, or a mammoth with impressive antlers, and see not use-value (tools, meat, artistic material), but exchange-value, how many things (including favours/debts from one's fellow people) one could exchange it for. This spurs the incentive to figure out how to produce more commodities for exchange faster, but in the palaeolithic and mesolithic these tendencies are very much marginal—in earliest periods, like pre-100,000bc, either non-existent or undetectable—with the main things exchanged being particularly fancy or useful stones for toolmaking.
Why is exchange marginal in these early periods, and why does the commodity not rule society? Because there's less people, and these people are more mobile. If a foraging band needs stone, in most cases they go set up camp by the stone and get some. In later periods (post100,000bc-ish) there might be people who have "home bases" they return to, store stuff at, trade from, and defend territorially, but in these earlier periods the evidence shows a people that had absolutely no permanent settlements, little to trade, and no way to accumulate anything but people's favours/debts—if they can even be called "debts" in a period before there is a state to enforce payment.
Accumulation of "debt" by giving gifts, feasts, etc, doesnt seem to persist beyond a person's lifetime. If Bob was cool and always gave you nice stuff you might feel indebted to him if he asks a favour, but his son won't inherit anything, largely because there's no propertt to inherit. If the son is a nice guy, one might still help him out in memory of his father, but if he's a jackass there's no cops forcing you to pay "inherited debt." At worst, if you're the only one who thinks Bob jr sucks, you might have to go find some other forager band to join.
How does this so-called "primitive" communism collapse? With the increase of human populations over the later palaeolithic and mesolithic, and their related accumulation of knowledge, intensive rather than extensive foraging develops. People forage more intensely over a smaller area, and develop more territorialness over their area. Consequently now if one wants a specific type of stone it may not be possible to just go get it unless its quite nearby. Instead one will need to exchange something else for it. And with a base camp, it becomes possible to accumulate a larger supply of goods. But there is still little to accumulate besides favours.
With the emergence of the holocene, these tendencies are supercharged; production and population increases a lot in the milder holocene climate as regular seasons begin. In the levant, the Natufian archaeological culture developed full time sedentism, based still on hunting and gathering, which eroded its own basis for existence within a few thousand years. Facing the decline in local plants and animals populations, people began to domesticate them, at first haltingly and then more quickly, leading to the neolithic.
With full time sedentism, exchange becomes even more important, and with the domestication (enslavement) of animals, a form of moveable, accumulable, heritable, property emerges. This private wealth challenges the public, eventually indebts more and more people to itself and begins to establish even larger settlements. In mesopotamia, the earliest and largest emerged, first with the protocities of the ubaid period and then with the full urbanism, writing, etc, of Uruk.
With the emergence of Uruk and its expansion, surrounding societies are pushed towards mimicking Uruk (and later Akkad, Babylon, etc) in the same ways those in the imperial periphery are pushed today: on the one hand, by their own elite made fabulously wealthy by trade centralise power for their own benefit; and on the other hand defense against Uruk and other protocities requires such centralisation. Much like the USSR couldnt simply choose to move to full communism under siege, the primitive communists could not maintain their communism under assault by Uruk.
After a few thousand years of regularised commodity production and exchange, like the mass production of textiles by the temples slaves for export to oman and the indus in exchange for copper, money emerges a few hundred years BCE more firmly establishing and expanding commodity exchange.