Questioner: “What is the explanation of the Aayah, ‘They followed what the devils gave out (falsely of the magic) in the lifetime of Sulaiman. Sulaiman did not disbelieve, but the devils disbelieved, teaching men magic and such things that came down at Babylon to the two angels, Harut and Marut …?’” Baqarah 2:102
Al-Albaani: “There is no doubt that there is a difference of opinion concerning the aayah among the scholars of quranic exegesis [tafsir]. But that which I personally hold to be the stronger opinion is that the word maa [ما] in His Saying, “… and such things that came down at Babylon to the two angels …” is not the maa of negation but rather a relative pronoun, i.e., that Allaah, the Mighty and Majestic, sent down the two angels to teach magic to the people, since magic was widespread at that time and [as a result there was] confusion [in differentiating] between it and miracles which some of the Prophets would bring. Like the story of the magicians and Musa, عليه الصلاة والسلام, where Pharaoh, through the magicians, had wanted to misguide his people from the call of Musa to the Truth. Since what Pharaoh had come with was nothing but magic. Then, as we know, Allaah, the Mighty and Majestic, eradicated the magic of the sorcerers who then became Muslims, believing in Allaah, the Lord of all Creation. So their knowledge of magic was the reason which enabled them to distinguish between that which was mere slight of vision and magic and between reality, “Then Musa threw his stick, and behold, it swallowed up all the falsehoods which they showed!” Ash-Shu’araa 26:45.
The magicians believed in this reality before all of the other people since through their knowledge of magic they knew that it was nothing but concealment, disguising and deception which had no reality to it. Thus when they were overcome and dumbfounded by the miracle of Musa, عليه الصلاة والسلام, the difference between reality and magic became manifest to them [so they fell down prostrate], “Saying, “We believe in the Lord of all Creation.” Ash-Shu’araa 26:47.
So it was through Allaah’s Wisdom that He sent down two angels, Harut and Marut, so that they would teach the people magic not for the sake of magic but rather to enable them to recognise that magic which many of the imposters/fraudsters [dajjaals] used at that time to deceive and enslave the people. As occurs in the story of the boy and the sorcerer, and maybe you remember that story.
Its summary, and [it being so important] a summary of it must be mentioned, is that the [tyrannical] king of that time, who is the companion of the Trench mentioned in the Quraan [See Surah no. 85, Burooj], would use a magician in order to enslave the people. When this magician saw that he had grown old, become white haired and frail, he said to the king, ‘Chose a boy from the people for me who [I can teach such that he] will be able to help you after I am gone.’ Why? So that this king could continue to enslave his people through magic. This is how the kings of old were, taking advantage of the people through magic.
So Allaah, the Mighty and Majestic, sent the two angels to teach all of the people–not like what the king’s magician, the king of the Trench, did, since this magician had said to the king, ‘Chose a boy for me …’ since it did not suit him that the knowledge of magic become widespread among all of the people since then they would come to realize that the king was misguiding them through magic, something which then they would have come to know.
So Allaah through His Wisdom saw fit to send two Angels to teach magic to the people so that they would be able to distinguish between magic and a miracle. Because magic, without a shadow of a doubt, is a means of spreading corruption: Allaah said in the same aayah, “… but neither of these two (angels) taught anyone (such things) until they had said, ‘We are only for trial so disbelieve not (by practicing this magic).’ And from these (angels) people learn that by which they cause separation between man and his wife …”
So they came to teach magic for a purpose, but this teaching could lead to a trial, and thus they learn that which harms them and does not benefit them and that which causes separation between a man and his wife.
This is what I understand regarding the explanation of this aayah.
And Allaah knows best.”
Al-Fataawaa al-Kuwaitiyyah, pp. 49-51.
 [The compiler of the book, Amr Abdul-Mun’im Saleem has a footnote here where he says, “Ibn Jarir has mentioned the difference of opinion in the explanation of this aayah (2/419), so from them are some who say the Arabic word maa [ما] here means ‘did not’ [لم], i.e., that magic was not sent down to the two angels, and this saying has been reported from Ibn Abbaas and Rabee’ ibn Anas but with weak chains of narrations. And there are others who explained that maa here means ‘that which’ [الذي] as Shaikh al-Albaani said here, and this saying has been reported from Abdullaah ibn Mas’ood with a chain of narration which has some disconnection in it, it is also reported from Qataadah, Ibn Zaid and others–and this opinion is also the one preferred by Ibn Jarir at-Tabari.
It has been reported from Qataadah, with an authentic chain of narration (2/421), that he said, “Magic is of two types: magic taught by the devils, and magic taught by Harut and Marut.”
And Ibn Jarir at-Tabari clarified the wisdom behind the reasoning as to why Allaah sent down magic, and whether it was permissible for His Angels to teach the people magic, so he said, ‘If someone were to say to us, ‘And is it permissible [to say] that Allaah would send down magic or is it permissible for His Angels to teach the people magic?’ We would say to him, ‘Indeed Allaah, the Mighty and Majestic, [is the One who] has sent down good and bad, all of it, and He clarified all of that to His servants, revealing as such to His Prophets ordering them to teach His Creation and to make known to them what is permissible for them from that which is forbidden, such as fornication, stealing, and all of the other sins that He made known to them and forbade them from committing.
So magic is another one of those sins which He told them about and forbade them from practising. Having knowledge about magic is not a sin, just as there is no sin in [actually] knowing how to produce alcohol, or how to carve out an idol, a lute, or other types of [forbidden] amusement–rather the sin is in practising it and preparing such things. Likewise, there is no sin in having knowledge about magic, the sin is only in practising it and using it to harm people it is not permissible to harm.
So there is no wrongdoing in the fact that Allaah sent it down to His Angels and neither in the fact that His Angels taught it to whoever they taught it to from the people, since their teaching of that to whoever they taught it to was with the Permission of Allaah after they informed [whoever they would teach it to] that they were a trial and test and after they would forbid them from practising it and from disbelief. So the sin was only on whoever learnt it from them and then practised it, since Allaah, Lofty is His Mention, has stated that He had forbidden them learning and then practising it …”
 The compiler, Amr Abdul-Mun’im Saleem, said here, “And the complete aayah pointsto what Ibn Jarir mentioned, i.e., that the two Angels would teach the knowledge of magic but would never order that it be practised–rather that they would forbid it in the extreme, warning against it severely.”