One of the stories in the Quran, is the story of Haroot and Maroot. Allah Says what means: “And they [i.e., the Children of Israel] followed [instead] what the devils had recited during the reign of Sulayman (Solomon). It was not Sulayman who disbelieved, but the devils disbelieved, teaching people magic and that which was revealed to the two angels at Babylon, Haroot and Maroot. But they [i.e., the two angels] do not teach anyone unless they say: ‘We are a trial, so do not disbelieve [by practicing magic].‘ And [yet] they learn from them that by which they cause separation between a man and his wife. But they do not harm anyone through it except by permission of Allah. And they [i.e., people] learn what harms them and does not benefit them. But they [i.e., the Children of Israel] certainly knew that whoever purchased it [i.e., magic] would not have in the Hereafter any share. And wretched is that for which they sold themselves, if they only knew.” [Quran 2: 102]
The Children of Israel received a Great Book from Allah, namely the Quran, which confirmed what they had been told in the Tawrah (i.e. Torah); they were claiming to adhere to their scripture, yet they disbelieved in the Messenger (Muhammad) and a group of them also threw the Scripture of Allah (i.e., the Tawrah) behind their backs and shunned it, despite them knowing that it was the truth, as Allah tells us, saying what means: “…A party of those who had been given the Scripture threw the Scripture of Allah [i.e., the Tawrah] behind their backs as if they did not know [what it contained].” [Quran 2: 101]
It is the way of Allah that He punishes those who shun that which benefits them; He, therefore, busies them with things that are of no benefit to them or make them indulge in what harms them. Whoever shuns the worship of the Most Merciful will be afflicted with the worship of idols.
Whoever shuns Islamic monotheism will be afflicted with association with Allah. Whoever shuns the Sunnah will be afflicted with religious innovation. Whoever shuns adhering to the Islamic texts will be afflicted with blind imitation of others who have no evidence to back up their actions.
Whoever shuns hoping in, loving and fearing only Allah will be afflicted with directing all these acts to other than Him. Whoever refrains from spending his wealth for the sake of Allah will be afflicted with spending it for the sake of Satan.
Whoever shuns humbling himself to Allah will be afflicted with being humiliated by other people, and whoever shuns the truth will be afflicted with adhering to falsehood.
This is exactly what happened to the Jews when they shunned the Book of Allah; they were afflicted with following in the footsteps of Satan. During the reign of Sulayman, they refused to believe in the Book of Allah and were thus afflicted by following what the devils recited and invented.
The devils introduced magic to the people and claimed that Sulayman used magic and that it was the means for him to have such great power and a vast empire.
Indeed they lied because Allah is the One who granted him enough power and such a vast empire that he had no need to resort to magic or to seek the help of the devils. As a matter of fact, Allah facilitated the devils for the disposal of Sulayman; Allah Says what means: “They made for him what he willed of elevated chambers, statues, bowls like reservoirs, and stationary kettles…” [Quran 34: 13]
Allah utilized them for Sulayman to use, and so they were under his command, but after the death of Sulayman the devils came out to the people claiming that the reason behind his control over them was the magic he used and practiced, but Allah exposes their lie saying what means: “And they [i.e., the Children of Israel] followed [instead] what the devils had recited during the reign of Sulayman. It was not Sulayman who disbelieved …” [Quran 2: 102]
Whoever practices or uses magic is a disbeliever, but Sulaymaan never disbelieved and never practiced magic; indeed Allah confirms the very opposite, saying what means: “…It was not Sulaymaan who disbelieved, but the devils disbelieved, teaching people magic…” [Quran 2: 102] They disbelieved by teaching people magic and how to use it, thereby misguiding them.
The Jews practiced the magic that Allah sent the two angels with, namely Haroot and Maroot, as a means of testing people and seeing who amongst His slaves would remain steadfast and who would deviate, or who would remain upon faith and who would disbelieve.
These two angels, Haroot and Maroot, were sent to teach people magic in the land of Babylon in Iraq as a test for these people. One may ask: “How can Allah send these two angels to teach people magically if practicing magic is disbelief?” The answer is that it is done in order to subject people to a trial, as Allah Says what means: “…But they [i.e., the two angels] do not teach anyone unless they say: ‘We are a trial, so do not disbelieve [by practicing magic]…’” [Quran 2: 102]
These angels would initially warn people not to learn this magic, and that to do so would entail disbelief, but if they insisted on learning magic, then they would teach them it; this magic could thereafter be used for prohibited reasons, such as to separate spouses. The Jews practiced the magic that they accused Sulayman of using.
The Jews learned magic and became specialists in it, and to this day the most skilled magicians are the Jews, especially the Moroccan Jews. These Jews shunned the news of the description and imminent arrival of the Prophet Muhammad that was in their scripture; they also shunned the new Book (i.e. the Quran); they eschewed all this and instead resorted to learning and practicing magic.
In this story, Allah mentions some of the evil consequences of magic, such as what means: “…And [yet] they learn from them that by which they cause separation between a man and his wife…” [Quran 2: 102]
This is while Allah describes marriage as something that results in harmony when He Says what means: “…He placed between you [i.e., man and his wife] affection and mercy….” [Quran 30: 21]
Magic separates man from his wife, which is proof that it does have an effect, but this effect only occurs by the will of Allah. Some types of magic make a person love another and act as if he is enslaved to him or her; such a person would feel that he simply cannot live without this person; another type of magic results in the opposite, whereby a person may hate another to the extent that he cannot even look him in the eye; a father can be bewitched in order to make him despise his children or wife, as in the previously mentioned verse of Chapter Al-Baqarah.
Allah Says what means: “But they [i.e. the Children of Israel] certainly knew that whoever purchased it [i.e. learned and practiced magic] would not have in the Hereafter any share.” [Quran 2: 102]
The scholars differed in their interpretation of this verse. Some of them stated that Allah did not send down these angels with magic to teach people, but rather it was the devils who taught people magic. On the other hand, many from the Salaf (predecessors) were of the view that Allah sent down to the earth these two angels from the heavens as a punishment to them; others said that they were angels who deviated and were an exceptional case from all the other angels, who never disobey Allah; yet others said that they were honourable angels who were sent down to teach people magic as a way of testing them, but who only taught those who insisted on learning it after having been informed and reminded that magic is a form of disbelief, and after having been sternly warned against learning and practicing it.
Undoubtedly, learning magic is prohibited, and practicing it is disbelief, as indicated in the verse, in addition to many prophetic narrations that affirm this fact.