Direct and Indirect Reciprocity
"Traditional evolutionary biologists had already worked out a couple of mechanisms by which members of some species innately cohere as cooperative groups. For example, kin selection instinctively prediposes social animals to powerfully favour close genetic relatives. This explains things like bee colonies, lion prides, and human nepotism.
Amongst unrelated, selfish people, reciprocal altruism can explain exchange and cooperation in the absence of a central authority — as long as they live in small communities where people know each other and are locked into repeated interactions over time. In such a context, the promise of future benefits and retaliation against cheating are sufficient for rational calculation to generate the “I will share my Mastodon steak with you now, assuming that you will share with me in the future” principle.
Even in populations where people don’t know each other directly, it’s still possible to generate “spontaneous order” as long as the group has high community cohesion due to ethnic or religious identity. This “indirect reciprocity” was in my opinion best illustrated by economist Avner Greif. Making inferences from documents deposited in the Cairo Geniza, Greif argued that informal institutions regulated commerce amongst the Maghribi Jewish traders as they conducted long-distance trade with one another in the Mediterranean during the Middle Ages. The strength of ethnoreligious ties (especially as a minority in a wider world), maintained by strong exclusion of outsiders, reproduced a village-like flow of information even within a far-flung community and enabled reputation and ostracism to be the instruments of policing.
Of course, as anyone who has read Thomas Sowell knows, such commercial minorities are abundant even today and operate effectively in corrupt countries with weak legal institutions, such as the Lebanese in West Africa and Latin America, or the Chinese in Southeast Asia. And even in countries with strong legal institutions, ultra-Orthodox Jews conduct a major international trade in diamonds without much reliance on external authorities.
But most people agree these mechanisms — kin selection and reciprocity — by themselves cannot sustain a cooperative equilibrium in much larger societies composed of strangers who may never interact more than once and are separated by great distances." (https://evonomics.com/pro-social-institutions-come/)