Earlier quoted context omitted.
Punishment is a deterrent though, at least for somewhat rational and premeditated acts, so it has an effect (though it's hard to quantify exactly). It's not a linear effect (as in threat of twice punishment = twice as effective as a deterrent), but it's certainly not zero. Additionally, punishment often goes hand in hand with making it harder/impossible to re-offend. If you're in prison, you're not breaking into anyb…
I've posted this before but I think it bears repeating: Study after study[1] has shown that an individual's perception of the likely punishment (e.g., prison time) doesn't deter crime. Rather, an individual's perception of the likelihood they'll get caught seems to be the main deterrent. This is a really interesting & related read.[2] [1] https://www.journals.uchicago.edu/doi/abs/10.1086/670398 [2] https://undark.org…
The point isn't that punishment isn't a deterrent, it's the only external deterrent (and you could argue that a bad conscience is self-punishment). It's that the likelihood of getting caught is a very important factor, not so much the severity of the punishment.
In RTS games, there's the idea of overkill: a unit (or set of units) does so much damage that it would kill the attacked unit multiple times. That's a problem, because you waste a lot of the damage, it's generally more efficient to do less damage more often for the same DPS (damage per second). I believe that you can think about punishment in a similar way. With the likelihood of punishment staying the same (for example: 10%), a hike of "somebody stares angrily at you" to "you spend 10 years in prison" very much acts as a deterrent. You get barely any more value out of that being 20 years though, because of "over-deterrence". Here as well, the same punishment with more frequency (=likelihood of punishment) would be more efficient.