In his 1776 work An Inquiry into the Nature and Causes of the Wealth of Nations, Scottish moral philosopher Adam Smith identified the cause in a single variable: “the propensity to truck, barter, and exchange one thing for another.” Today we call this free trade or market capitalism, and since the recession it has become de rigueur to dis the system as corrupt, rotten or deeply flawed.

If we pull back and take a long-horizon perspective, however, the free exchange between people of goods, services and especially ideas leads to trust between strangers and prosperity for more people. Think of it as ideas having sex. That is what zoologist and science writer Matt Ridley calls it in his book The Rational Optimist: How Prosperity Evolves (HarperCollins, 2010). Ridley is optimistic that “the world will pull out of the current crisis because of the way that markets in goods, services and ideas allow human beings to exchange and specialize honestly for the betterment of all.”

Sex evolved because the benefit of the diversity created through the intermixture of genomes outweighed the costs of engaging in it, and so we enjoy exchanging our genes with one another, and life is all the richer for it. Likewise ideas. “Exchange is to cultural evolution as sex is to biological evolution,” Ridley writes, and “the more human beings diversified as consumers and specialized as producers, and the more they then exchanged, the better off they have been, are and will be. And the good news is that there is no inevitable end to this process. The more people are drawn into the global division of labour, the more people can specialize and exchange, the wealthier we will all be.”

In the teeth of the recession and the reality of more than a billion impoverished people in developing countries today, this thesis sounds ripe for skepticism, indeed almost blindly Pollyannaish. But Ridley systematically builds a case through copious data and countless studies that “the vast majority of people are much better fed, much better sheltered, much better entertained, much better protected against disease and much more likely to live to old age than their ancestors have ever been. The availability of almost everything a person could want or need has been going rapidly upwards for 200 years and erratically upwards for 10,000 years before that: years of lifespan, mouthfuls of clean water, lungfuls of clean air, hours of privacy, means of traveling faster than you can run, ways of communicating farther than you can shout,” and with more access to “calories, watts, lumen-hours, square feet, gigabytes, megahertz, light-years, nanometers, bushels per acre, miles per gallon, food miles, air miles, and of course dollars than any that went before.”

Trade does something even more important than enrich our lives. It makes people behave more fairly. In a March 18 article in Science entitled “Markets, Religion, Community Size, and the Evolution of Fairness and Punishment,” University of British Columbia psychologist Joseph Henrich and his colleagues engaged nearly 2,700 people in 15 small communities around the world in two-player exchange games in which one subject is given a sum of money (the equivalent of a day’s pay) and allowed to keep or share some or all of it with another person. You would think that most people would just keep all of the money, but in fact the scientists discovered that members of hunter-gatherer communities shared about 25 percent, whereas members of societies who regularly engage in trade gave away about 50 percent. Although religion was a modest factor in making people more generous, the strongest predictor was “market integration,” defined as “the percentage of a household’s total calories that were purchased from the market, as opposed to homegrown, hunted, or fished.” Why? Because, the authors conclude, trust and cooperation with strangers lowers transaction costs and generates greater prosperity for all involved, and thus concepts of fair trade emerged as part of a larger process of social evolution to maintain mutually beneficial exchanges even when the participants were not bound by kinship, status or other social ties.

In other words, our ancestors had sex with people they knew, but their ideas had sex with strangers, and this form of trade led to trust and prosperity.