They could also use massive doses of morphine (or fentanyl these days), though they don’t because it’s too pleasant a way to go. If they’ve sentenced someone to death, presumably for some heinous crime, they don’t want to put them down like a beloved elderly Labrador.