The Evolution of Cooperation ISBN 0465021212 is a book by political science professor Robert Axelrod which explores the conditions under which fundamentally selfish agents will spontaneously cooperate. To perform this study, Axelrod developed a variation of the Prisoner's dilemma (henceforth PD) game, involving repeated PD interactions between two 'players' (ie, strategies written as computer programs) in a computerised tournament. This 'iterated prisoner's dilemma' (IPD) format, he found, tends to offer a long-term incentive for cooperation, even though there is a short-term incentive for defection (Axelrod's term for the opposite of cooperation).

Axelrod invited academic colleagues all over the world to devise strategies to compete in an IPD tournament. The results ranged in many variables: algorithmic complexity, initial hostility, capacity for forgiveness, etc. After an initial tournament that simply compared pairs of strategies for success when paired in an IPD, Axelrod arranged a meta-tournament where strategies represented sub-populations in a large population of agents, and an agent could switch to another strategy if it noticed that one of its neighbors was using that strategy with greater success than its own. This second tournament led to Axelrod's concept of an evolutionarily stable strategy.

The book included two chapters comparing Axelrod's findings to surprising findings in seemingly unrelated fields. In one of these, Axelrod examined spontaneous instances of cooperation during trench warfare in World War I. Troops of one side would shell the other side with mortars, but would often do so on a rigid schedule, and aim for a specific point in the other side's trenches, allowing the other side to minimize casualties. The other side would reciprocate in kind. The generals on both sides were satisfied that shelling was occurring and therefore the war was progressing satisfactorily, while the men in the trenches found a way to cooperatively protect each other.