Affirmative action (AA) is a government policy permitting employers and universities to give preferential treatment to applicants from specific (e.g. racial) groups. We present a comparative analysis of AA in six countries (India, USA, Malaysia, Canada, South Africa, and Brazil) and explain similarities among these programs according to universal psychological mechanisms and variation according to cultural-historical contexts. It appears that similarities in contextual conditions (e.g. democratic government, multi-ethnic states) interact with ancient psychological mechanisms (e.g. fairness, cheater detection, alliance tracking) to provide at least part of the motivation for the development and expansion of AA, despite its problematic consequences.