Cooperation prevails in many collective endeavours. To ensure that co-operators are not exploited by free riders, mechanisms need to be put into place to protect them. Direct reciprocity, one of these mechanisms, relies on the facts that individuals often interact more than once, and that they are capable of retaliating when exploited. Yet in groups, strategies targeting retaliation against specific group members may be unfeasible, because individuals may not be able to identify clearly who contributed and who did not. Still, they may assess what constitutes a fair income from a collective endeavour. We discuss here how conditional cooperation in group interactions emerges naturally and how natural selection leads populations to evolve towards a specific level of fairness (Van Segbroeck et al., Phys. Rev. Lett., 108:158104, 2012), contingent on the nature and size of the collective dilemma faced by individuals.