According to basic Islamic teachings, God created three intelligent races: Angels, jinns, and humans, of which the latter two have been granted free will to choose between good and evil.
Iblis was a jinn and a devoted servant of God. He attained a very high status and was brought close with the angels. God knew Iblis harboured ill intentions, however, and this was the reason for his name, Iblis "Desperate," or "despair."
The angels do not have free will and simply do not sin because they were not granted the freedom by God to disobey. When God created Adam, He commanded all the angels and jinn to prostrate to him as was termed "the Best of Creation". All the angels and jinn did so except Iblis
, who refused to obey.
And We created you (humans), then fashioned you, then told the angels: Fall ye prostrate before Adam! And they fell prostrate, all save Iblis, who was not of those who made prostration.
He said: "What hindered thee that thou didst not fall prostrate when I bade thee?" (Iblis) said: "I am better than him. Thou createdst me of fire while him Thou didst create of clay". [Qur'an 7:11]
Iblis was proud and arrogant and considered himself superior to Adam, since Adam was made from clay and Iblis was created from smokeless fire. For this act of disobedience, God cursed him to Hell for eternity, but gave him respite until the Day of Judgment, after Iblis requested it. Iblis obtained permission from God and vowed that he would use this time to lead all human men and women astray to Hell as a way of revenge against them. By refusing to obey God’s order he was thrown out of Paradise and thereafter he was called “Shaitan”.
He said: Then go down hence! It is not for thee to show pride here, so go forth! Lo! thou art of those degraded.
He said: Reprieve me till the Day (of Judgement) when they are raised (from the dead).
He said: Lo! thou art of those reprieved.
He said: Now, because Thou hast sent me astray, verily I shall lurk in ambush for them on Thy Right Path.
Then I shall come upon them from before them and from behind them and from their right hands and from their left hands, and Thou wilt not find most of them beholden (unto Thee).
He said: Go forth from hence, degraded, banished. As for such of them as follow thee, surely I will fill hell with all of you.[Qur'an 7:14]
Although God grants the request, He also warns the Shayṭān that he would have no authority over His sincere ‘ubūd "devoted servants".
Lo! My (faithful) bondmen - over them thou hast no power, and thy Lord sufficeth as (their) guardian