Science Daily explains it all quite well.
Proc. Natl. Acad. Sci. USA, 10.1073/pnas.0712173105
Selfishness as second-order altruism
Omar Tonsi Eldakar, and David Sloan Wilson
Selfishness is seldom considered a group-beneficial strategy. In the typical evolutionary formulation, altruism benefits the group, selfishness undermines altruism, and the purpose of the model is to identify mechanisms, such as kinship or reciprocity, that enable altruism to evolve. Recent models have explored punishment as an important mechanism favoring the evolution of altruism, but punishment can be costly to the punisher, making it a form of second-order altruism. This model identifies a strategy called "selfish punisher" that involves behaving selfishly in first-order interactions and altruistically in second-order interactions by punishing other selfish individuals. Selfish punishers cause selfishness to be a self-limiting strategy, enabling altruists to coexist in a stable equilibrium. This polymorphism can be regarded as a division of labor, or mutualism, in which the benefits obtained by first-order selfishness help to "pay" for second-order altruism.