Why do some people try to hurt other people that have done nothing wrong to them?

For example the 2022 texas school shooting. I’m sure those children that died didn’t do anything to harm or provoke the shooter.
Updates
1 y
I’m assuming a lot of these people probably have some sort of psychological or mental problem.
Why do some people try to hurt other people that have done nothing wrong to them?
Post Opinion