The Goodness Paradox – How Evolution Made Us Both More and Less Violent
by Richard Wrangham.
Darwin’s conclusion was forthright. The morality problem could be solved by an ancient system of execution leading to the eradication of selfishly immoral individuals, which would lead to selection against selfish tendencies and in favor of social tolerance.

On My Kindle
Loc 2129
If comparable kinds of punishment had been applicable throughout human evolution, genes promoting aggressive behavior would have been steadily selected against. Generation by generation, less aggressive, more positively moral behavior would tend to spread.
…
Darwin’s conclusion was forthright. The morality problem could be solved by an ancient system of execution leading to the eradication of selfishly immoral individuals, which would lead to selection against selfish tendencies and in favor of social tolerance. Through this kind of natural selection, he wrote, “the fundamental social instincts were originally thus
gained.”
Loc 4066
Proactive aggression is not produced by individuals in a fit of rage, or in an alcoholic haze, or out of a testosterone-induced failure of cortical control. It is a considered act by an individual or coalition that takes into account the likely costs. It has a strong tendency to disappear when it does not pay.