My own theory is that prison has been set up to remove potential criminals from the street, chosen via a demographic of education/ethnicity/wealth/gender/aggressiveness, during their prime years of being a nuisance. The results don't have to be particularly fair.
There's no real intention of transformation or revenge, just a form of quarantine.
Looking at a chart of incarceration rate over time and murder rate over time, this last a better indicator of crime than most, you can make a case that the big ramp up in jailing somewhat matches the peak and fall of murders. It's tough to find causalities in anything, but I rather like that one.