Evolution through natural selection is intensely competitive, yet altruistic cooperation is remarkably common. It is found in social insects, human society, and even cells of multicellular organisms. Why individuals cooperate is one of the central puzzles of evolutionary theory. Here we describe advances in understanding the evolution of cooperation.