Despite sometimes selfish instincts, cooperation abounds in human societies. Using mathematical models to explore this complex feature of social behavior, a team shows that the act of taking another person’s perspective — a form of empathy — supports the persistence of cooperation and altruism.