Charity, do-gooding, philanthropy it’s all just selfishness masquerading as virtue. So says the cynic. In modern times, the theory that each of us, despite occasional appearances of self-sacrificial nobility, is ultimately and invariably looking out for No. 1 got a big boost from Darwin’s theory of evolution. By the logic of natural selection, any tendency to act selflessly ought to be snuffed out in the struggle to survive and propagate. So if someone seems to be behaving as an altruist  say, by giving away a fortune to relieve the sufferings of others  that person is really following the selfish dictates of his own genes. The evolutionary psychologist Randolph Nesse confessed that he slept badly for many nights after absorbing this supposed discovery, which he called “one of the most disturbing in the history of science.”

Before resigning ourselves to a similar spell of disillusioned sleeplessness, it might be instructive to test this theory against a particular case of philanthropy. In recent years, Bill Gates has channeled billions of his dollars to a foundation devoted to fighting disease and poverty. The Bill and Melinda Gates Foundation may today be the single-most-powerful force in the world for the relief of suffering. But what, one might ask, is in it for Bill?

Evolutionary psychologists have come up with four plausible Darwinian reasons for altruism. First, there is “kinship selection,” which is supposed to lurk behind the sacrifices you make for your biological family. It’s based on the percentage of genetic overlap. One biologist, when asked if he would lay down his life for his brother, quipped, no, but he would for two brothers or eight cousins.

Second, there is “reciprocal altruism,” which doesn’t depend on shared genes. Here, the basic idea is: You scratch my back, I’ll scratch yours. Reciprocal altruism is seen not just in humans but in some animal species. Vampire bats, for instance, benefit one another by sharing meals of regurgitated blood.