What is considered as evil does not exist in the realm of abstract beings; this discussion has to do only with the material world. Good and evil have been defined in this manner: Good is that which one’s nature desires and what one chooses from amongst several things, while evil is the opposite.
Things in general can be divided into five groups when it comes to being evil or good; only two of these groups actually exist: Pure good which is God, and predominant good. As to those things that have some evil in them, what the will of God and His decree is oriented towards, is the existence and good therein. In other words, that particular thing/entity had the potential of receiving existence, and in even clearer words, it is God who creates it, and God’s will that brings it into existence and His decree that it is subject to. But the evil and privation that come along with such things/entities aren't associated with God, they are rather associated with lack of any further potential for receiving existence and good.
Before giving any explanation in regards to this question, it is necessary to note that the discussion of good and evil is an important albeit dangerous one; philosophers have presented many different theories in this regard, nonetheless, the answer given to the problem of evil by most Islamic philosophers and theologians in the Islamic arena is the same.
That which is referred to as ‘evil’, only exists in the material world, and has nothing to do with the realm of abstract beings (such as angels).
Good and evil have been defined in this manner: Good is that which one’s nature desires and what one chooses from amongst several things, while evil is the opposite.
Good and evil things can be divided into five groups:
1. Pure good
2. Pure evil
3. Predominant good
4. Predominant evil
5. Equally good and evil
From among these five groups, only two actually exist:
1. Pure good, which is a necessary being that is pure perfection bearing all existential perfections.
2. Predominant good, meaning something whose good outweighs its evil, because in the abandonment of abundant good lies much evil and privation. So God has deemed necessary and willed that these two groups come into existence. As for the other three groups, they don’t exist, because, pure evil is the same as pure privation, which cannot exist due it being pure inexistence and having no place in the existential universe. As to the other two groups, meaning predominant evil and equal evil and good, their existence is incompatible with God’s grace, since God has created the universe in the most perfect and well-established form possible, and if one focuses on the phenomena in this world, he will find that everything in the universe has been created in the most perfect form possible.
To elaborate, the picture of privation that we have in our minds is either total privation, or the opposite of total existence, or a relative non-existence in the sense of privation (adam al-malakah), meaning the privation of a virtue for something that bears the capability of possessing such a virtue. An example of such would be blindness, which is actually the absence and privation of sight in a person who could have possessed the faculty of sight (this is why a wall can't be called ‘blind’, because although a wall cannot see, blindness is a non-existent in the sense of privation that can only be attributed to something that could have been sighted but isn't. Clearly, a wall isn't something that bears the potential of being sighted, so it is neither correct to refer to a wall as being blind, nor sighted).
The first division can be assumed in different modes. One would be to assign privation to the whatness (mahiyyat) of something instead of its existence. For example, we can picture the absence of a person, and assume him to be non-existent, not after he has existed. This division is but merely a conception devoid of any form of evil, the reason being that we haven't taken the subject to be something common in ‘existence’ and ‘non-existence’, resulting in its non-existence being evil. However, one may make the privation of something contingent upon itself, an example being when we picture something that actually exists to be non-existent, and then to assume it as non-existent after it has come into existence. Such a privation is evil, nonetheless, this division of privation is in reality, the non-existent in the sense of privation, something that will be explained later in this article. The second mode would be to compare the absence of something with something else, such as the absence of a necessary being in relation to contingent beings, or the absence of humanity for another thing like a horse, or the absence of an animalistic essence for plants, or the absence of a cow in a horse; this division of privation is a consequence of quiddities, and is something imaginative and not really existent.
The second type of privation, is the non-existent in the sense of privation, which is the absence of a quality in something that has the capability of possessing it. Deficiencies, shortcomings, sickness, pain and calamities are examples of things that befall other things, who are supposed to lack them and instead bear their opposing virtues. For example, health is something a person should have; this makes sickness a non-existent in the sense of privation.
This type of privation is evil, and is found in material and has to do with the deficiency in material’s potential, which varies from one material thing to another; the point trying to be made is that the origin of these types of privation which are actually evil, isn't the source of existence, meaning God, and they cannot be ascribed to Him, because the reason for privation, is itself, while the cause of existence cannot be privation.
So the extent that these things – that are a combination of existence and privation – are intended and willed by God, is the extent of the existence they bear, and in other words, the amount of potential they have for receiving existence. It is because of this that it can be said God has created it, God’s will has brought it into existence and it is God’s decree that it is subject to. As to the privations (evils) that come along with it, they aren't associated with God, they are rather associated with the lack of further potential and capability. Also, the reason why such privations are considered to be existent is due to the fact that they are in conjunction and unity with that amount of existence.
 Tabatabai, Muhammad Husayn, Nihayat al-Hikmah, Shirwani, Ali, vol. 3, p. 352, Bustane Ketab, sixth edition, Qum, 1384 (solar).
 Tabatabai, Muhammad Husayn, Tafsir al-Mizan, Farsi translation, Musavi Hamedani, vol. 13, p. 259, Association of Seminary Teachers, fifth edition, Qum, 1374 (solar).