Jerks exist because they've been selected by Natural Selection.

Either the existence of a Jerk helps the Jerk himself survive and propagate his genes or the existence of a Jerk within a group helps groups that contain jerks survive.

If you think about it at a very surface level. Everyone hates Jerks so why does a Jerk even exist at all? Everything a Jerk does will lower his individual chances of survival by making people hate them. Humans are social creatures and an anti-social person likely will not survive if the group hates them.

Group dynamics of humans will ultimately select out Jerks. That is unless the Jerk has something to offer beyond making everyone hate them.

Obviously Jerks exist in our world, so their continued existence must offer something beneficial to the group. What would that be?

So imagine this situation. There's a software engineer at a company who's well liked. He's super nice, friendly, good-looking BUT he's ultimately not a very good software engineer. His skills are well below average, his boss knows it, everyone who's worked with him knows it, the only people who don't seem to know it is he himself and people who haven't directly worked with him. His skills are so poor that he would be fired if he wasn't so well liked.

Therein lies the problem. His Boss likes him but is unable to be honest with him about how his skills are so horrible that he'll be fired if everyone knows about how shitty his skills are. The person is so nice and well liked that not only is his career getting protected but his feelings are being protected as well because nobody wants to be a Jerk and hurt those feelings by telling him the reality.

Then a real Jerk of a person is suddenly assigned to work with this nice guy. The Jerk immediately sees the problem and reveals the truth to everyone. The Jerk regularly says things along the lines of: "This guy is useless, he doesn't know shit, the guy can't even code properly. His code is complete garbage." The Jerk publicly says these things and reveals to everyone the reality of the situation.

These are very toxic words that introduce aggression into the workplace.

But the Jerk introduces truth into the workplace. The Jerk was the only person who tells things like it is at face value. If the Jerk wasn't there, the well liked person would continue to be in that role and function as a parasite with the person himself and most of the company oblivious to the reality of the situation.

The cost of empathy is a mask placed over reality.

If your organization doesn't have Jerks then I almost guarantee that there is very likely to be huge issues within the organization that are masked by etiquette. The Jerk is essentially telling the truth and revealing big issues at great cost to himself. It's almost a form of self sacrifice.

In my my mind the Jerk exists because he benefits the group, but his actions come at great cost to his individual survival because Jerks aren't well liked.

Additionally I would argue that the term "Jerk" is a misnomer. Someone who is explicit about the truth should not be called a Jerk, especially when the truth comes at such a high cost.

The real Jerk is someone who deliberately covers up the truth. A manipulative person is never called a Jerk. A company without a single Jerk, a company where people have nearly perfect etiquette and friendly communication is also a company with a high number of manipulative people and likely deep problems that aren't discussed.

I don't know about you, but I'd rather deal with an oblivious Jerk than a well liked manipulator.