Animal societies vary widely in the diversity of social behaviour and the distribution of reproductive shares among their group members. It has been shown that individual condition can lead to divergent social roles and that social specialisation can cause an exacerbation or a mitigation of the inequality among group members within a society. This work, however, has not investigated cases in which resource availability varies between different societies, a factor that is thought to explain variation in the level of cooperation and the disparities in reproductive shares within each social group. In this study, I focus on how resource availability mediates the expression of social behaviour and how this, in turn, mediates inequality both within and between groups. I find that when differences in resource availability between societies persist over time, resource-rich societies become more egalitarian. Because lower inequality improves the productivity of a society, the inequality between resource-rich and resource-poor societies rises. When resource availability fluctuates over time, resource-rich societies tend to become more unequal. Because inequality hinders the productivity of a society, the inequality between resource-rich and resource-poor societies falls. From the evolutionary standpoint, my results show that spatial and temporal variation in resource availability may exert a strong influence on the level of inequality both within and between societies.