Here's something that happened where I live several years ago.
Two guys robbed a liquor store.
A few minutes later, their car was pulled over for speeding, by a cop who had no idea that this car was being driven by people who had committed a robbery.
The driver shot and killed the cop.
Other officers joined the pursuit, and to make a long story short: the killer was himself killed in a gun battle with police, while the unarmed accomplish was caught and arrested after trying to flee on foot.
Under Minnesota law, you can be given the death penalty if you were involved in a crime in which a police officer was killed. The accomplice was convicted and sentenced to death. During the trial, the letters to the editor in the local paper were filled with letters crying out for justice and therefore supporting the conviction and sentence.
So I thought to myself: what if the actual killer has been taken alive? What if he had received the death penalty and the accomplice had recieved a lesser sentence? I strongly suspect that most of those letter writers would have been perfectly satisfied with that scenario and felt that justice had been served. (Admittedly, I cannot ever know this, of course. But consider what your own reaction would be.)
But the murderer had inconveniently been killed, so we the public could not vent our anger on him. So his accomplice, who as I recall did not even realize that the killer was carrying a gun during the robbery, was the recipient of the public's wrath in the true murderer's place.
I concluded that in this case at least, the death penalty was less about people's sense of justice and more about a need for vengeance. After all, if a lighter sentence for the accomplice would have been considered a just sentence in the hypothetical case in which the killer survived , how can that lighter sentence NOT be considered just in the actual scenario in which the killer was dead? Either the accomplice deserves death or he doesn't, regardless of who else survived to stand trial.
We have a department of justice and a department of corrections, but not a department of vengeance.