1. Pleading Guilty
If you plead guilty to any offence at the first oppertunity you are likely to get about a 1/3rd reduction in sentencing. What's published is the final sentence given, not what the judge regarded as the right sentence for the crime.
2. Selective Reporting
There is very little percentage in reporting cases where someone commits an ordinary crime and gets a reasonable sentence. The media will only report it if the crime is unusual, or the sentence is obviously insufficient or excessive. It's not even considered particularly newsworthy to report long sentences, unless the crime involved is also interesting.
In one terrorist trial, a defendant, requesting an estimate of sentence, was told that, taking into account that he was neither an instigator, nor principle planner or participant in an intended attack, he should expect a sentence of around 50 years...
3. Misunderstanding of Sentencing
The media like to report figures. They like to say that someone got 5 years or whatever, when in fact they got *life* with a recommendation that they serve *at least* 5 years. That does not mean they get out after 5 years, it means after 5 years the probation authorities (not the judges) can *consider* letting them out. The media do not understand, or do not bother to explain, the meaning of sentences given.
Take the case recently reported of a teenage rapist, the media generally reported that he got 3 years. What he actually got was an indeterminate sentence for the public protection, which is similar to a life sentence. Again, he can be considered for release after 3 years, but the decision is for the probation service, as to whether they believe he is still a threat. If he remains a threat he will (in theory) remain in prison. Indefinately.
4. Sentencing Guidelines.
Judges do not just make it up as they go along. For many of the more common crimes there are sentencing guidelines on which sentences are based. Departure from those guidelines can result in an appeal against sentence. The guidelines are not written by the judiciary, and are influenced by politics and administrative considerations (like the number of prison places).
5. Memory.
Injustice is more keenly felt than justice. People are more likely to recall an inadequate sentence than a satisfactory one, and it is more likely to come to mind next time the issue arises.