Why do humans get random thoughts of violence that we discard?
They are there to be discarded! Don’t listen to your mind’s madness! Hehehe.
These thoughts are coming from what in spirituality is called “ego”. They can be of both violence directed to others and to yourself. Ego is suffering, it’s in constant pain, it is basically the accumulation of all emotional trauma you have suffered unconsciously since your early childhood. Don’t listen to them, they are all bullshit, but listen to emotions that arise in the body when these thoughts are present, and allow yourself to experience the emotion, don’t avoid it. That is, if you hate somebody, allow yourself to hate them, allow yourself to experience all the anger and all the pain that is there for that person. Be compassionate to yourself, there is no wrong emotion to have, it is nobody’s fault.
This is the only way to dissolve it and let it go. But don’t act on thoughts, they are stupid and irrational, they don’t serve you. What’s there is there, emotionally, you can’t run away from it, but thoughts are junk, and you know that, otherwise you wouldn’t be asking this question, but running around hurting people instead.