China uses a single shot to the back of the head, while Indonesia uses a firing squad. The evidence obtained to justify the death penalty is sometimes tainted. It eliminates the possibility of an escape and future victims.
Executions, especially where they are painful, humiliating, and public, may create a sense of horror that would prevent others from being tempted to commit similar crimes When we carry out a death sentence, it is an irreversible sentence.
Stinney was denied appeal and electrocuted. It may be that executing criminals will still only deter five would-be murderers. Many see the penalty as barbaric and against American values.
In an advanced society, though, there is always a high financial price that we pay for being just and humane, and that price is worth it.