It’s called the SOCIAL DOMINANCE HIERARCHY OF PRIMATES. Its the reason you have serotonin.

We all do it, every waking moment. There is no case where one is not higher than the other. Period. Sorry. That’s just the science. And it’s a biological necessity.

We are more sensitive to status than any other perception.

https://www.quora.com/Why-do-people-discriminate-against-others-but-dislike-it-when-they-are-discriminated