If one of you 'cooperates' and the other 'defects', the defector will get off scot-free while the cooperater will receive the heaviest sentence possible. Over a longer time frame, however, 'cooperating' makes more sense. Dawkins ran simulations of the game where different strategies were played off each other - some more cooperative, some tending more to 'defect', some making random moves, some cooperating until the other player 'defects', after which they bore a 'grudge' and defected. The most successful strategies tended to be basically canny cooperative strategies which also took into account whether its colleague defected, in which case they would be more likely to defect. This came as a surprise to a lot of biologists and economists who assumed that the more competitive strategies would always tend to win out.
Survival depends on other people, and no one wants to cooperate with someone who is always selfish.
In this way, Dawkins seemed to show that altruism and self-interest are extremely compatible. I actually suspect that altruism is more important to long-term human evolution than egoism. Devotees of Thomas Hobbes may assert that there is 'no such thing as altruism', but values such as love, friendship and empathy are ultimately essential for the survival of our species, and maybe life itself. Whether you see this as an evolutionary process or as something that comes from God and is hard-coded into the structure of the Universe doesn't really matter. The conclusion, in short, is that in the long run, nice guys finish first.