When the chance of meeting again is big enough, helping first pays
You take in a delivery for the neighbor across the hall once, which costs you 10 minutes. Some day when you come home loaded with bags, if he's willing to lend a hand, he can save you 40 minutes. Call the chance that the two of you run into this kind of thing again and he's willing to return the favor p. On average, the time you can expect to get back is this chance times 40 minutes, that is, 40p minutes. Helping first is only worth it if this is more than the 10 minutes you spend:
40p>10
Divide both sides by 40, and p has to be more than a quarter: out of four times, more than one has to bring a chance to meet again and get paid back. If the chance is only one in ten, you can expect 4 minutes, which isn't worth it; if the chance is a half, you can expect 20 minutes, and helping pays.
Defect once and it pays you back once; come back and it goes back to normal
Suppose the scoring is: both cooperate, 3 each; both defect, 1 each; one defects alone and gets 4, while the one defected against gets 0. Your opponent plays tit for tat. In round 10 he cooperates as usual and you defect, gaining 1 extra point. In round 11 he defects in turn. If you keep defecting, you both get 1, which is 2 less than cooperating, and he'll keep hitting back, so you lose 2 every round. If you go back to cooperating, you get 0 this round, 3 less; in round 12 he follows you and cooperates, and you're both back to 3 each. The cheapest path is to gain 1 and then lose 3: a net loss of 2 points.
It never beat a single opponent, yet its total ranked first
Tit for tat never defects first, so in each match the best it can do is tie with its opponent. But the tournament compares the scores added up across all matches. With opponents willing to cooperate, it gets 3 each the whole way; against one that always defects, it only loses out in the first round. The programs that tried to get a little ahead in every match got stuck defecting as soon as they met one another, and their totals couldn't climb.
This approach works best when the dealings will continue, you can recognize each other, and defecting can be seen. If you meet only once, or one side will never be able to pay back, helping and keeping your word can't earn back their cost; and if nobody notices defecting, the defector has no reason to fear being hit back. Treat every kind act as an investment, asking what you'll get back even for helping a stranger, and human warmth gets thinned out by the counting.