Lets start with bullying. Animals have ways of eliminating the weakest among them. Herds turn against individual animals they don’t want in the herd. The kid who gets bullied today eons ago would have been killed off. In schools children determine each other’s position and status within the herd. Bullying is part of the process.
So, what about school shootings? In early years, being rejected is devastating. It is a life changing experience. Instinctively, being part of the herd is a matter of life or death. Being kicked out or not accepted by the herd is a death sentence in most species.