Here is a tl;dr for no one to read. It is my attempt at explaining why mass shootings occur and what causes people to snap and do the unthinkable. This is going to come from my perspective of my experiences with suicidal tendencies and the way the brain works.
From my point of view, I get suicidal thoughts during the bad parts of my manic-depression cycle. For me, I call this period of time "the window". This window is the point of time where it seems like a good idea to rid this world of myself. For me, I think of it like this: if there was a switch to turn me off and remove me from the universe, I would flip that switch at this time. Other people have other feelings such as "I'm going to show them" or "I want to kill myself and see the faces of the people who are causing me this pain as they have to face up to the fact that they caused this". That is utter bullshit and shows that you are a self-righteous, self-important piece of shit. The core message from the brain to your soul or vise-versa is that "the world would be better off without me".
This window of time I will call "the first window". This window is serious. The reason that it is serious is because no one else knows that something is wrong with you and you are too proud or too whatever to tell anyone else that something is seriously wrong with you. So you sit with it and try to digest it. My windows last about 30 minutes or so. The time where I would genuinely consider pulling the trigger if I had a gun.
There is a recovery time after this happens. For me, it is about a week or so. If something extremely bad happens during that week, a second window appear. This is what I would call "the dangerous window". For me, this window lasts the better part of a day and I can't shake it. This is where all the vitriol comes to play. At this point, you no longer care about the consequences of your actions. You are just going to do because you are not in control of yourself. For me, that is where self-harm comes into play. Who better to hurt than myself if I have to hurt someone? That isn't going to be the case for everyone else. Other people are going to be selfish in their own ways and choose to fuck everyone else over, or become infamous or whatever their stupid point is.
That's about it. Human beings are pretty much the same. We all carry the same emotions whether we want to admit to it or not. Some people take the stupid way out of life because they can't control themselves and don't have a support network to save them from doing such a thing.