Not quite the way it happens.
I am fortunate to have met, on FR, a person who worked for a three-letter-agency, who actually orchestrated these sort of events (in foreign countries -- apparently that restriction has been lifted?). That person apparently passed on, I couldn't get in touch with him when I reached out some time later.
It is well-known by these agencies how to cause an actor to commit these sort of acts of violence. He actually explained how. It is located here.
Its all psychological manipulation with a little assistance from operatives. Just an example of how it could be pulled off...
1. Set the goal - create mass shooting at X location.
2. Identify target matching psychological profile that would carry out the act. Example - troubled college student with psycholoical problems that is unconfident, has relatiobship problems, one parent family, has anger issues, pays attention or has commented on social problems in social media, is under psychologists’s care, is on psychotropic drugs
3. Engage target online speaking to issues that anger him acting setting up a profile that appears as the perfect adversary; if he is black, be white supremist; make statements will provoke him over and over into it forments into rage. Make him feel inferior like you are looking down on him. Dare him.
4. Ensure that he gets access to a gun via using an operative who is a plant that befriends him using a cover as a student. Plant thoughts that he needs to buy one for self ptotection from the white supremist buddy. Show him websites that feed the hatred and violence to solve his “problem” (other white people).
5. Create emotional disturbances and events that will cause hime to need to unleash. If he has a girlfriend steer her to a white man. She dumps him. He now wants revenge.
6. Make sure he takes his meds...
In other words steer him right down the channel to the target incident. All the while he is being monitored and evaluated to ensure that he is manipulated to commit acts if violence that he feels are justified in his drug addled state...