According to the verses and narrations, God is Compassionate and Merciful and He also has the qualities of anger and indignation. That is, He is both All-Forgiving and severe in punishment, He is the most Merciful of the merciful ones (arham al-rahemeen) and very exacting at the time of giving exemplary punishment and chastisement to wrongdoers. In the Holy Quran, any utterance containing intimidation or punishment is followed by words of mercy and forgiveness. Perhaps, the secret is that one of the noble virtues of human beings is to always live between fear and hope and in order for him not to become proud of divine mercy or despair of divine mercy, God speaks of both mercy and retribution to create a balance. Therefore, God is not only the most Merciful of the merciful ones but He is also severe in punishment and severity of punishment is one of his major attributes. Therefore, it is wrong to ask why God, the Glorified, orders a sinner to be punished. In fact, the punishment does not run counter to His mercy because He is both Forgiving and severe in punishment (shadid al-iqab).
Naturally, one who is subjected to any kind of retaliation or punishment must have committed an unpardonable crime or he must have violated someone’s rights. Any offense or encroachments on the rights of others is an evil act which harms the community or corrupts the society. In order for the society to be protected against any harm, it is necessary to fight the evils or anything that may affect social wellbeing. Divine mercy requires that the society should, in the first place, be guarded against deviations and declination. Divine mercy requires that there should be rules which should prevent or reduce crimes in society. That is why we believe that retribution, punishments and the likes are not only not opposed to God being the most Merciful of the merciful ones but being the most Merciful would require the Lord to enact such laws.
It seems that the above question originates in two ambiguities:
1- Is God only the most Merciful of the merciful ones?
2- Is divine retribution or punishment opposed to God’s being the most Merciful of the merciful ones?
Considering the Quranic verses and prophetic traditions, we understand that God possesses all attributes of perfection. In other words, He has both affirmative and negative attributes together. That is to say, as we believe He has the attributes of mercy and compassion, we also believe that He has the attributes of anger, revenge and indignation. If He has promised us paradise, He has also frightened us of Hell fire. If He has promised to forgive us, He has also promised to punish. Hence, we see that He introduces his Prophet as a Bearer of good news and a Warner.
God is both All-Forgiving and severe in punishment (shadid al-iqab). We see in the traditions from the Infallible Imams, peace be upon them, that God has been described both as the most Merciful of the merciful ones and severe in punishment.
Fear and hope
Mostly, the Quranic verses contain both promises and threats; it gives both good news and warnings so as to help improve the two causes e.g. fear and hope which form the motives behind the evolutionary move. That is because “self-interest” and “averting harm” are two driving forces affecting man’s behavior and conduct. In other words, in the Holy Quran, any utterance containing intimidation or punishment is followed by words of mercy and forgiveness. Perhaps, the secret is that one of the noble virtues of human beings is to always live between fear and hope and in order for him not to become proud of divine mercy or despair of divine mercy, God speaks of both mercy and retribution to create a balance: “Indeed none lose hope in the mercy of Allah except the disbelieving people.” God wants man to live between fear and hope. It is stated in the narrations related from the Ahlul-Bait (A.S.) that fear and hope should be like the two sides of scales with neither side weighing over the other side. Fear and hope are the two basic elements of faith and morality. Without the presence of these two principles, the faith is not complete. Having said that, we come to know that it is wrong to ask why God, the Glorified, orders the sinner to be punished. In fact, the punishment does not run counter to His mercy because He is both Forgiving and severe in punishment. The principle that forgoes punishment is none other than the principle of mercy. Now, mercy is a major attribute of God. If we take other the attributes of God into consideration, do retribution and punishment run counter to God being the most Merciful of the merciful ones?
Naturally, one who is subjected to any retaliation or punishment must have committed an unpardonable crime or violated someone’s rights. Any offense or encroachments on the rights of others is an evil act which harms the community or corrupts the society. In order for human society to be protected, it is necessary to fight evils or anything that may affect social wellbeing. We can fight the evils in two ways. One, superficial combat like fining, imprisoning etc. and another is an all out and deep-rooted combat such as retaliation, punishments and the likes. Islam has chosen the second method because, according to Islam, as also endorsed by all wise men and women of the world, a society is far more important and respectable than an individual. The punishment cannot be termed as something originating in the feeling of revenge. Therefore, the divine mercy requires that, in the first place, the society be protected from decline and deviation and to enact such laws which would result in reduction of crimes. Hence, we are of the view that retribution, punishments and penalties and the likes are not only not opposed to God being the most Merciful of the merciful ones; rather divine mercy requires that such laws be enacted. God says in a beautiful verse of the Quran:
وَ لَكُمْ فِي الْقِصاصِ حَياةٌ يا أُولِي الْأَلْبابِ لَعَلَّكُمْ تَتَّقُونَ
“And there is life for you in (the law of) retaliation, O men of understanding, that you may guard yourselves.”
In reality, retaliation and blood money is a window opening to life; it guarantees survival and integrity of human society; because if these laws never existed and stone-hearted people felt secure, the lives of innocent people would be endangered. On the other hand, it ensures protection and wellbeing of the criminal because it restrains him, to a great extent, from committing crimes. In addition, the Law of Equality (in terms of retaliation) prevents consecutive crimes and gives an end to the ignorant tradition which, at times, brought about more and more crimes followed by other crimes. This is how the penal and retaliatory rules guarantee survival and continued existence of society.
The medical system, agriculture, animal husbandry and so on and so forth are based on this rational principle (elimination of dangerous and annoying being); because we see, for example, a limb is cut off when it is terminally infectious and out of function or harmful to the body. In the same way, the additional, harmful or hindering branches of a tree are trimmed to let the healthy branches grow. For example, those who see the killing of a murderer as annihilation of yet another person have an individualist perspective. If they take the interest of the society into consideration and are fully aware of the role of preserving and teaching other individuals, they will reconsider their sayings. Killing of killers and blood-thirsty people in society is just like cutting off an infectious or harmful organ or branch which must be removed. It goes without saying that as of today no one has objected to cutting off an infectious, dysfunctional and harmful organs or branches.
The conclusion is that: First, God bears affirmative and noble qualities. As He is the most Merciful of the merciful ones, He is also severe in punishment.
Second, although in the first glance, punishing criminals look to be a bit cold-blooded act, given the criminal act of the criminal on the one hand and the deterrent aspect of the punishment on the other, it becomes clear that enactment of such laws seems to be essential to human society.
Here it is necessary to make a point clear.
Considering the narrations according to which a person who is punished in this world shall not be punished in the hereafter, or in other words, one who is punished because of his crimes and offense in this world shall not be subjected to punishment in the afterworld, this indeed is an act of divine mercy. For this reason, we read in the history that in the early period of Islam some people would refer to the Imam (A.S.) to ask him how to purify themselves from sins or deliver themselves from divine punishments. They confessed their sins and wanted that divine punishments be conducted on them.
 - Ya Sin, 63.
 - Hud, 2, That you may worship none but Allah. Verily, I have come to you as a warner and a bearer of good news from Him
 - Tusi, Tahzibul Ahkaam, vol.3, p. 108, Dar al-Kutub al-Islamiyah, Tehran, 1365 (1986):
اَللّـهُمَّ اِنّي اَفْتَتِحُ الثَّناءَ بِحَمْدِكَ، وَاَنْتَ مُسَدِّدٌ لِلصَّوابِ بِمَّنِكَ، وَاَيْقَنْتُ اَنَّكَ اَنْتَ اَرْحَمُ الرّاحِمينَ في مَوْضِعِ الْعَفْوِ وَالرَّحْمَةِ وَاَشَدُّ الْمُعاقِبينَ في مَوْضِعِ النَّكالِ وَالنَّقِمَةِ، وَاَعْظَمُ الْمُتَجَبِّرِينَ في مَوْضِعِ الْكِبْرياءِ وَالْعَظَمَةِ
“O Allah, I begin the glorification with praise of Thee; Thou, from Thy bounties, gives out freely the truth and salvation; I know for certain that Thou art the most merciful in disposition of forgiveness and mercy [but] very exacting at the time of giving exemplary punishment and chastisement to wrongdoers, the Omnipotent in the domain of absolute power and might.
 - Makarem Shirazi, Nasir, Tafsir Namunah, vol.18, p. 273, Dar al-Kutub al-Islamiyah Publications, Tehran, first edition, 1374 (1997).
 - Yusuf, 87.
 - Amin, Sayyida Nusrat, Makhzan al-Irfan dar Tafsir Quran, vol.2, p. 262 and 263, Muslim Women’s Movement Publications, Tehran edition, 1361 (1982).
 - Baqara (2): 179
 - Makarem Shirazi, Naser, Tafsir Namunah, vol.1, p. 606 and 607 (with little modification).
 - Kulayni, Al-Kafi, p. 445, hadith 6, The Commander of the Faithful, Ali (A.S.) interpreting the following verse: “And whatever affliction befalls you, it is on account of what your hands have wrought, and (yet) He pardons most (of your faults)” (Shura, verse 30) says, ‘No vein cramps up, no one strikes a stone, no one slips and no bruise occurs with a stick except due to a sin. Surely, what Allah forgoes is more (that what he does not). Whomsoever God punishes for his sin, indeed God, the Exalted and Glorified, is too Merciful and Great to punish him once again in the afterworld.’
 - A woman went to the Commander of the Faithful, Ali bin Abi Talib (A.S.) and asked him to punish her for the sin of adultery she had committed. She wanted to purify herself and was saying: “I am afraid lest I should die and go to the next world without purging myself.” For further information about the details of this narration, see Behar al-Anwar, vol.76, hadith 45 and “Man La Yahzuruhu al-Faqih, translated by Ghaffari, vol.5, pg. 356 – 358.