Psychological processes underlying cooperation in social dilemmas