The Dark Magic or Black Magic came into being from the period of Sulaiman (Alaihi Wassalam). ALLAH the most high, provided Sulaiman (Alaihi Wassalam) with power to rule over mankind, jinns, birds etc.
As ALLAH the Almighty says: “And We had certainly given to David and Solomon knowledge, and they said, “Praise [is due] to Allah , who has favored us over many of His believing servants.” “ (Surah An-Naml, Verse 15)
At that period, descended two Angles Harut and Marut. They where the trials for the believers. Harut and Marut before starting to teach they would warn the people and jinns about it, as it is bad. But, the Devils i.e.., the Shaytaan continued to learn it. And they taught the Dark Magic or Black Magic to the mankind.
As it’s mentioned in the Holy Qura’an in Surah Al-Baqrah, Verse 102: “And they followed [instead] what the devils had recited during the reign of Solomon. It was not Solomon who disbelieved, but the devils disbelieved, teaching people magic and that which was revealed to the two angels at Babylon, Harut and Marut. But 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 the people learn what harms them and does not benefit them. But the Children of Israel certainly knew that whoever purchased the magic would not have in the Hereafter any share. And wretched is that for which they sold themselves, if they only knew.”
It all happened when the Prophet Sulaiman (Solomon) (Alaihi Wassalam) lost his kingdom. But, once ALLAH have it back to him, he buried all the writings of the Shaytaan under his throne and warned them to not touch it. After the death of Prophet Sulaiman (Alaihi Wassalam), the Devils i.e.., Shaytaan took out those buried writings and began to spread it. That’s how today, The Dark Magic or Black Magic is being performed.This also gave a path towards fortune-telling. Remember, nothing can work without the order of ALLAH the most-powerful.