Axelrod's Tournament
In 1980 the political scientist Robert Axelrod invited people to send in computer programs that would play a repeated prisoner's dilemma against each other. Every program played every other program over many rounds, and the points were added up at the end. Some of the entries were long and complicated, but the winner was one of the shortest, a strategy called tit for tat, sent in by Anatol Rapoport.
Tit for tat is really simple. It cooperates in the first round, and after that it just copies whatever the other player did in the round before. Axelrod ran a second, bigger tournament after publishing the results, and tit for tat won again.
Tit for tat against a player who defects once in round 3.
Why It Works
Axelrod pointed out a few things that made tit for tat do so well. It is nice, meaning it never defects first. It retaliates, so it can't be taken advantage of for long. It forgives, going back to cooperating as soon as the other player does. And it is clear, so other programs could easily figure out what it was doing and learn that cooperating pays.
The bigger lesson is that cooperation can come about without anyone forcing it, as long as the players expect to meet again. Axelrod called this the shadow of the future.