Hierarchy in the Forest by Cristopher Boehm is literally about this. In short, we've always had some kind of "hierarchy", but starting at about 3 million years ago, and becoming ubiquitous at around 300,000 years ago, we "inverted" the hierarchy so that domineering individuals were ostracized, and everybody else was more or less equal. In other words, we found a way to be egalitarian, despite our despotic roots as a species - and we did it for long enough to significantly impact the human genome.
Then the domineering individuals started to figure out how to undo this and form dominance hierarchies again, starting about 40,000 years ago.