That's [not just] the way it is, yes.
What you asked originally was: why do people kill other people? How do they reach the decision to do so?
Then you narrowed it down, ignoring the most powerful and prolific occasion of human-human killing, to your idea of irrational homicide, bringing in a whole lot of unexamined assumptions about the thought-process you initially wanted to study.
If you start at the end, you're so far from why and how that there can be no coherent answer.
The why begins with: It's natural. We evolved over a hundred million years, killing for sustenance and in self-defense, for territory and resources.
Societies - not only human ones, all social animals - create rules and protocols to regulate the use of violence, especially of deadly force, within their own communities. They generally outlaw interpersonal violence between citizens, but do not outlaw its use against prey, chattels, enemies, rivals and threats.
When you bring that long, long history of violence as a solution to problems, you can see why people still apply the same logic in private life, even when it's against the rules. How often the rules are broken is one indication of how well the society functions.