Allah (swt) legislated the punishments in Islam as deterrents and consolations. They are deterrents in order to deter people from committing the crimes. They are also consolation for they take away from the Muslim the punishment of Allah (swt) at the Day of Judgement.
The fact that the punishments in Islam are deterrents is established by the text of Qur’an. Allah (swt) says:
“And there is life for you in retaliation, O men of understanding.”
[TMQ Al-Baqarah: 129]
The fact that Allah (swt) made life in the retaliation means that carrying out the retaliation (punishment) is what saves the life. This is not by saving the life of the one who was punished, for in the retaliation (punishment) is his death and not his life, rather the life of the one who witnessed the occurrence of the retaliation. This is generally the case of the sensible person, when he knows that he will be killed if he killed another, then he would not be involved in killing. This is the case of all the deterrents.
These punishments are only inflicted on the criminal. For the meaning of being deterrents, is that people are deterred from the crime, ie, refrain from committing it.
The crime is the ugly action. The ugly action is that which the Shar’ dispraised. Thus, an action is not considered a crime unless the Shar’ stated it is an ugly work, and then it is considered a crime.
The offence does not exist in the innate nature of man, nor is it gained. It is not also a disease by which man is inflicted. It is rather a violation of the system that organises mans’ actions.
This is because Allah (swt) created man and created in him instincts and organic needs. These instincts and organic needs are life energy in man that drives him to satisfy them. So he carries out the actions he does for the sake of this satisfaction.
Leaving this satisfaction without a system leads to anarchy and disorder, and it leads to the wrong or abnormal satisfaction.
Allah (swt) organised the satisfaction of these instincts and organic needs when He (swt) organised man’s actions by the ahkam shar’iyyahah. So the Islamic Shar’ explained the treatment of man’s actions in the form of guidelines that came in the Kitab and Sunnah. It made in these guidelines the reality of the hukm for every incident that occurs to man. It legislated the halal and the haram. So it brought that from which the hukm of every action of man can be deduced. It also explained the things it prohibited on man. Therefore, Shar’ has brought orders and prohibitions, and commissioned man to do what it ordered him with, and to abstain from what it forbade him. If man violated that he would have done an ugly work; ie he made a crime; whether this was the negligence of doing what he was ordered to do, or undertaking that which he was forbidden from. In both cases, he is considered to have committed a crime. Therefore, it was necessary to have punishment for such crimes, so that people abide by what Allah (swt) ordered them with, and to abstain from what He (swt) forbade them. Otherwise, there would be no sense in these orders and forbiddings if there was no punishment against their violation. For there is no value for any request to be undertaken if it had before it a punishment to the one who does not carry out such a request, whether this request was a request to do an action or to abstain from an action.
Islamic Shar’ explained that there are punishments in the akhira (Hereafter) and others in the worldly life, on these crimes. As for the punishment of the akhira, it is Allah (swt) who punishes at the Day of Judgement. Allah (swt) says:
“The guilty will be known by their marks, and will be taken by the forelocks and the feet.” [TMQ Ar-Rahman:41]
“And those who disbelieved, they have the fire of jahannam.” [TMQ Fatir: 36]
“This (is for the righteous). And Lo! For the transgressors there will be an evil journey’s end… Hell, where they will burn, and evil resting place.” [TMQ Sad: 55-56]
“Lo! We have prepared for disbelievers manacles and carcass and a raging fire.” [TMQ Al-Insan: 4]
Allah (swt) explained these punishments explicitly in Qur’an. So they will definitely take place, because they were mentioned in ayaat that are definite in proof and definite in meaning.
Allah (swt) says:
“When carcass are about their necks and chains. They are dragged. Through boiling waters; then they are thrust in the fire.” [TMQ Gafir: 71-72]
“Therefore, he has no close friend here this day. Nor any foods save filth. Which none but sinners eat.” [TMQ Al-Haqqa: 35-37]
“Boiling fluid will be poured down on their heads.” [TMQ Al-Hajj: 19]
“Lo! the guilty are in error and madness. On the day when they are dragged into the fire upon their faces (it is said to them): feel the touch of hell.” [TMQ Al-Qamar: 47-48]
“In scorching wind and scalding water. And shadow of black smoke.” [TMQ Al-Waqi’a: 42-43]
“You verity will eat of a tree called zaqqoom. And you will fill your bellies therewith. And thereon you will drink of boiling water. Drinking even as the camels drink.” [TMQ Al-Waqia: 52-55]
“Then the welcome will be boiling water. And roasting at hell-fire.” [TMQ Al-Waqi’a: 93-94]
“But nay! For Lo! It’s the fire of hell. Eager to roast.” [TMQ Al-Maarij: 15-16]
“(It will be said): Take him and fetter him. And then expose him to hell-fire. And then insert him in a chain whereof the length is seventy cubits.” [TMQ Al-Haaqqa: 30-32]
“As often as their skins are consumed We shall exchange them for fresh skins that they may taste the torment.” [TMQ An-Nisaa’: 56]
Thus, there are many ayaat that explain the torment of Allah (swt) in a definite way and in a miraculous style. When man hears them, the fright will grip him and the terror will fill him. He will belittle every torment in the dunya, and every physical hardship, if he conceived the torment and the fright of the torment of the akhira. Thus he will not dare to violate the orders and prohibition of Allah (swt), unless he had forgotten this torment and its fright.
This is the punishment of the akhirah. As for the punishment of the dunya, Allah (swt) explained it in the Qur’an and hadeeth in a general and detailed from. He (swt) answered the State to carry it out.
The punishment of Islam that He (swt) stated to be imposed on the guilty in the dunya; the Imam (Muslim Leader) or his deputy undertakes it. In other words the Islamic State carries it out through the execution of the hudood (determined punishments) of Allah or what is less of the hudood in terms of the ta’zeer (discretionary punishments) and kaffarat (atonements). This punishment in the dunya over a specific sin, carried out by the State, eliminates the punishment of the Hereafter from him. Thus, punishments are deterrents and eliminators. They deter the people from doing the offences and from committing the crimes and sins. They also eliminate the punishment of the akihrah, thus the punishment of the akhira will be abolished from the Muslim.
The evidence on that is what al-Bukhari narrated from ‘Ubadah bin as-Samit (ra) who said: “Rasool Allah (saw) said to us at a gathering: ‘You give me bai’ah that you do not associate anything with Allah, you do not steal, you do not commit adultery, you do not murder your children, you do not forge lies amongst yourselves and you do not disobey in a ma’roof (good action). Whoever of you fulfilled that he has his reward with Allah. And whoever committed anything of that and punished in the dunya then it will be atonement to him, then his matter is with Allah. If He wished He punished him, and if He wished He forgave him.’ So we gave him bai’ah over that.”
This is explicit that the punishment of the dunya by the Imam or his representative over a specific offence would abolish the punishment of the akhirah. That is why many Muslims used to come to Rasool Allah (saw), where they would acknowledge the guilts they did so as to inflict on them the hudood (punishment) in the dunya so that the torment of Allah (swt) at the Day of Judgement is abolished from them. They would hear the pains of the hudood and retaliation in the dunya because it is easier than the torment of the akhira.