The research shows that very moment we start identifying any group, may it be religious, ethnic or other, we start perceiving people who are not part of the group as outgroup. And moment we start see others as part of outgroup we start treating them differently. If it happens psychologically we call it prejudice and when it starts reflecting on our actions and behaviour it is discrimination. There are two possible path forward. One as refered as characteristics of mature or self actualised personality, we are able to get rid of group identity and consider ourselves individuals propelled by virtues of rationality and empathy. Second, if we are greared towards some superordinate goal or a goal that binds as all like climate change.
However, it is our basic insecurity about our future or resources that makes us believe that we would be better without other group ( a completley false perception). So lack of tolerance is phenomenon which was there before and it is still there and I reckon unfortunately will exist in future. The only thing that matters as a society are we able to react and contain these intolerences to bare minimum.