It is self-hatred that they take out on others:
"The term self-hatred can refer to either a strong dislike for oneself, one's own actions, or a strong dislike or hatred of one's own race, gender, nationality, sexual orientation, or any other group of which one may be a member. When used in the latter context it is generally defined as hatred of one's identity based on the demographic in question, as well as a desire to distance oneself from this identity. This tends to involve welcoming and accepting antagonistic views towards one's group from other groups and promoting these views to members of own group, while rejecting any opposing view with uses of argumentum ad hominem (e.g. 'racist', 'extremist', 'sexist') rather than reasoned arguments, whether the personal attacks stand or not."
https://en.wikipedia.org/wiki/Self-hatred