Based on the theory of eusociality and multilevel selection.
Individuals act selfishly to pass on their own genes. However individuals form groups to cooperate; group formation is a function of selflessness. Groups compete and groups with better cooperation out compete groups with less cooperation.