  Cooperative behavior lies at the very basis of human societies, yet its
evolutionary origin remains a key unsolved puzzle. Whereas reciprocity or
conditional cooperation is one of the most prominent mechanisms proposed to
explain the emergence of cooperation in social dilemmas, recent experimental
findings on networked Prisoner's Dilemma games suggest that conditional
cooperation also depends on the previous action of the player---namely on the
`mood' in which the player currently is. Roughly, a majority of people behaves
as conditional cooperators if they cooperated in the past, while they ignore
the context and free-ride with high probability if they did not. However, the
ultimate origin of this behavior represents a conundrum itself. Here we aim
specifically at providing an evolutionary explanation of moody conditional
cooperation. To this end, we perform an extensive analysis of different
evolutionary dynamics for players' behavioral traits---ranging from standard
processes used in game theory based on payoff comparison to others that include
non-economic or social factors. Our results show that only a dynamic built upon
reinforcement learning is able to give rise to evolutionarily stable moody
conditional cooperation, and at the end to reproduce the human behaviors
observed in the experiments.
