Looking at reality through the filter of economics captures all of life with some additional false positives (things that we do not classify as alive but still seem to trade time and energy for material and energy). Using investment as the filter eliminates the false positives at the expense of adding a far greater number of false negatives (most of life does not invest). Evolution is at play, rewarding species that are predisposed to invest (predisposed either directly through genes or indirectly via thought).
A side effect of investment is that one might produce a surplus of a desired product (such as food), possibly in amounts beyond what the individual can consume. It seems common enough for investing species to develop (in individual thought or in species wide genes) a protocol for sharing the occasional surplus with others.
In the simplest form, the genetically controlled protocol has no parameters and every incident is both like every other incident and at the same time independent of every other one. The next rung up the ladder, if you will, is where each act of sharing affects the social standings within a community. While I lack proof or references to supporting research, my crude thought experiments suggest that humans exhibit a range of mechanisms for long term profit from sharing, with the simplest being nearly indistinguishable from adjusting a single parameter that affects social standing. I suggest that prior to adopting systems of writing, much effort went into rememberring every sharing incident (transaction) so as to, over a long term, balance out the net benefit to each party, with some of the “corrections” being more of sharing the deficits than sharing the surpluses.
One might think that a barter system would relieve the burden on the memories of the individuals in a community, but further reflection ought to highlight the immense difficulty getting exchanges to balance the values of what is being traded. Given this limitation, one should expect that trading patterns in a community would be either between closely connected neighbors or be regularly recurring exchanges involving specialization (of skills or access to resources) or both. Some advances would be needed to enable communities (and civilizations), on more than a minimal scale, to practice, and profit from, specialization, investment, and exchange.
The reward for finding and using such advancements proved more than sufficient for several developments to come into practice, specifically counting (numeracy), writing (literacy), and money. These advances were repeatedly discoverred around the world.