The prisoner's dilemma is a canonical example of a game, analyzed in Game Theory that shows why two individuals might not cooperate, even if it appears that it is in their best interest to do so. It was originally framed by Merrill Flood and Melvin Dresher working at RAND in 1950. Albert W. Tucker formalized the game with prison sentence payoffs and gave it the "prisoner's dilemma" name (William Poundstone, 1992).
Solution? See Tit For Tat.