Question: What is magic?
Magic is a kind of deception and deceit, which makes people think that a supernatural event is taking place. It is an evil thing as it confuses people and distorts their perception of reality.
When Moses came to pharaoh, the pharaoh called the magicians of the city to frighten and disgrace him in front of the public. The magicians threw their wands and it seemed to people like snakes. But when Moses threw his staff, it ate what the magicians had thrown by the will of Allah. The magicians immediately understood that it was not magic and believed in Moses.
Magicians sometimes present themselves as having supernatural abilities like seeing the future or knowing things which they cannot normally know. Having claims like these or believing that someone can have these kind of supernatural powers is considered a great crime against Allah. One who commits such a crime will go directly to Hell unless repented before death.
 See the verses 7:111-122 in chapter Al-A’raf in Quran.