This phenomenon, albeit indirectly, is well explained by Richard Dawkins' book The Selfish Gene, which describes how genes use individual organisms to promote and spread themselves, using both selfish and altruistic strategies. Moreover, some genes modify the behavior of the individual to a greater extent, making him more aggressive.
This thing is easily transferred to the information space. Dawkins himself introduced the concept of a meme, as an analogue of a gene, now this word is more often understood as some kind of picture with a cat or a funny phrase, but in a broader sense it can be any idea, religious, political, or whatever. They enter our brain, are embedded in our thinking, and if we accept them as part of ourselves, then we continue to distribute them. It can be some kind humanistic ideas, ideas of enlightenment, or there can be aggressive and chauvinistic concepts. Their distribution depends not only on us, but also on the environment, and the Internet as a medium may turn out to be more convenient for some ideas and less convenient for others.
By the way, what is cool about The Question site is that here different topics and ideas can be discussed by the same people. Therefore, an opponent in any one issue is not necessarily an opponent in some other topic. And this of course reduces the division into "us" and "foes".
Because it's easier for a person - it eliminates the need to weigh and evaluate the statements of the interlocutor every time. It is enough to call him "liberal" or "putinoid", homosexual or homophobe once, so that you will never think about his statements again.