They may well be posited for deterrence but more likely were settled upon without anyone carefully considering what it would take to deter.
If they reflect retribution - just deserts - how do they compare with other sentences?