Hierarchy in the forest: the evolution of egalitarian behaviour