From Smithsonian:
Why do people show kindness to others, even those outside their families, when they do not stand to benefit from it? Being generous without that generosity being reciprocated does not advance the basic evolutionary drive to survive and reproduce. Christopher Boehm, an evolutionary anthropologist, is the director of the Jane Goodall Research Center at the University of Southern California. For 40 years, he has observed primates and studied different human cultures to understand social and moral behavior. In his new book, Moral Origins, Boehm speculates that human morality emerged along with big game hunting. When hunter-gatherers formed groups, he explains, survival essentially boiled down to one key tenet—cooperate, or die.
First of all, how do you define altruism?
Basically, altruism involves generosity outside of the family, meaning generosity toward non-kinsmen.
Why is altruism so difficult to explain in evolutionary terms?
A typical hunter-gatherer band of the type that was universal in the world 15,000 years ago has a few brothers or sisters, but almost everyone else is unrelated. The fact that they do so much sharing is a paradox genetically. Here are all these unrelated people who are sharing without being bean counters. You would expect those who are best at cheating, and taking but not giving, to be coming out ahead. Their genes should be on the rise while altruistic genes would be going away. But, in fact, we are evolved to share quite widely in bands.
More here.