Historically there was a time when it was possible to be convicted of a crime and punished with any amount of time in jail or any fine that the judge decided upon. Now judges cannot do this because the legal system decided to regulate the way that people were sentenced so that sentencing wasn’t so arbitrary. The government decided on guidelines for the sentences.
These guidelines base the sentence on two different considerations. The sentencing guidelines first consider the crime itself and what happened during the crime to alter the level of crime that this falls into. Then the consideration turns to the criminal history of the person who is being sentenced with a crime in order to raise the punishment for people who have previously been convicted.