Evil exists because this life is a test in which free beings choose, and the Qur'an teaches that Allah creates everything yet does no wrong, since the harm, pain and moral evil we see serve wise ends that He knows and we often do not.
- Scholars distinguish between evil in what is created and evil in the act of creating: Ibn al-Qayyim and others say that no evil is attributed to Allah Himself, though evil things can exist for a greater good.
- The Qur'an says that life and death are created to test which of us is best in deeds (67:2), and a test needs both ease and hardship, obedience and disobedience.
- Sunni theologians differ in detail: the Ash'aris say Allah creates human acts and people acquire them, the Maturidis give more weight to human choice, and the Mu'tazila say people create their own acts.
- Suffering is not a sign that Allah has abandoned a person, because the Prophet (saw) taught that the believer's trials erase sins and raise ranks, and the final judgement will settle every wrong.
Introduction
This is one of the oldest questions in religious thought. Philosophers call it theodicy: how can a creator who is good, wise and powerful allow evil, pain and cruelty? Muslim scholars have discussed it since the first centuries, and the Qur'an addresses it directly in several places. The answers fall into a few connected parts, and they do not treat the question as a trick. The pain is real, and the Qur'an does not deny it.
The starting point is two truths the Qur'an states together. First: "Allah is the Creator of all things" (39:62). Second: "Whatever good reaches you is from Allah, and whatever evil reaches you is from yourself" (4:79). A careful reading, as in al-Tabari and Ibn Kathir, shows the two do not conflict. Allah creates the world and its causes, and human beings are responsible for what they choose to do within it.
Evil as part of a created test
Allah says: "He who created death and life to test you, which of you is best in deed" (67:2) and "We will surely test you with something of fear and hunger, and loss of wealth, lives and fruits; and give good news to the patient" (2:155). A test is not possible without difficulty. If there were no hunger, no one could be generous. If there were no injustice, no one could stand for justice. If there were no temptation, there would be no struggle against the self. The Qur'an says that people are tested "with evil and with good" (21:35).
Imam al-Ghazali, in al-Iqtisad fi al-I'tiqad and Ihya' 'Ulum al-Din, held that the world as created is the best that could be, a position often summarised by the phrase that there is nothing in possibility better than what is. Other Ash'ari and Hanbali scholars, including Ibn Taymiyya, were wary of the phrase because it seems to limit Allah's power, but they agreed that nothing He creates is without wisdom. The principle is stated in the Qur'an: "Our Lord, You did not create this in vain" (3:191).
No evil is attributed to Allah
Imam Muslim records in the Book of Prayer that the Prophet (saw) used to say, in the opening supplication of the night prayer: "All good is in Your hands, and evil is not attributed to You." Ibn al-Qayyim, in Shifa' al-'Alil and Miftah Dar al-Sa'ada, explains this carefully. Evil, he says, is of three kinds: pain, which is evil only to the one who feels it; the sin, which is evil because of what the sinner chooses; and the loss of good. Allah's acts, in His wisdom, are good. Evil is found in some of what is created, not in the act of creating it. A doctor who cuts a limb to save a life does something good, though the patient feels pain. The Qur'an itself says: "It may be that you dislike something and it is good for you" (2:216).
Ibn al-Qayyim adds that Iblis himself is an illustration: his existence tests people, exposes who truly loves Allah, and gives meaning to repentance. Allah says: "Surely I will fill Hell with you and those who follow you" (38:85), and the Qur'an narrates that He gave Iblis respite for a purpose that includes this test. The Qur'an also seeks refuge "from the evil of what He created" (113:2), which affirms that harmful things exist and also teaches that we should ask Allah for protection from them.
Free will and what scholars say about it
The deepest part of the problem is moral evil, the wrong that people do. If Allah had wished, there would be no disbelief (6:107, 10:99), but He created beings who can choose. The Qur'an says: "Say: the truth is from your Lord, so whoever wishes let him believe, and whoever wishes let him disbelieve" (18:29). Yet the same Qur'an says: "You do not wish except that Allah wishes" (81:29). The scholars set out several positions here.
The Mu'tazila, such as al-Qadi 'Abd al-Jabbar, taught that people create their own acts and that Allah must do what is best for creation. This protects the justice of Allah but, according to their critics, limits His power. The Ash'aris, following Abu al-Hasan al-Ash'ari and al-Baqillani, taught that Allah creates every act and that the human being "acquires" it (kasb) by choice, so the person is accountable. The Maturidis, following Abu Mansur al-Maturidi, stressed the real power of human choice within Allah's knowledge and will. Ahl al-Hadith, including Ahmad ibn Hanbal and Ibn Taymiyya, affirmed both that Allah created the acts and that human beings do them with real will, and said that the way the two meet is part of the unseen. All of them agree that people are responsible for what they choose.
How the believer responds to suffering
The Prophet (saw) said: "How wonderful is the affair of the believer, for all of it is good, and this is for no one but the believer: if good comes to him he is grateful, and that is good for him; and if harm touches him he is patient, and that is good for him" (Sahih Muslim, Book of Zuhd). He also said: "No fatigue, illness, worry, grief, harm or distress befalls a Muslim, even the ***** of a thorn, except that Allah expiates some of his sins by it" (Sahih al-Bukhari and Sahih Muslim, Book of the Sick and of Righteousness). The Qur'an promises that the wrongs of this world are not final: the Day of Judgement will settle each of them (21:47), and the child who died, the oppressed and the wronged will be given justice.
Allah also says in a sacred hadith recorded by Muslim: "O My servants, I have forbidden injustice for Myself and made it forbidden among you, so do not wrong one another." The Muslim is therefore not asked to call evil good. He is asked to resist it, to help those who suffer, and to trust that the One who created the world is wiser and more merciful than any of His servants. The Prophet (saw) said that Allah is more merciful to His servants than a mother to her child, in the narration of 'Umar ibn al-Khattab (ra) in Sahih al-Bukhari and Sahih Muslim.
Conclusion
Allah created the world as a place of test, and a test needs real choices and real difficulty. The Qur'an and the scholars teach that the evil we see is not meaningless and that Allah does no injustice (4:40). They do not claim that every answer is within human reach, and they ask us to answer pain with patience and action. The final reckoning, in which every wrong is put right, is the other half of the answer. Allah knows best.
References
The Qur'an: 2:155, 2:216, 3:191, 4:40, 4:79, 6:107, 10:99, 18:29, 21:35, 21:47, 38:85, 39:62, 67:2, 81:29, 113:2.
Sahih Muslim: Book of Prayer (the opening supplication); Book of Zuhd (the affair of the believer); Book of Righteousness (the sacred hadith on injustice). Sahih al-Bukhari: Book of the Sick.
al-Ghazali, al-Iqtisad fi al-I'tiqad and Ihya' 'Ulum al-Din. Ibn al-Qayyim, Shifa' al-'Alil and Miftah Dar al-Sa'ada. Ibn Taymiyya, Majmu' al-Fatawa. al-Tabari and Ibn Kathir, commentaries on 4:79.