Magic refers to enchantment. One can think of magic as an art form that can be studied, practiced and performed. My husband is a magician and although he uses magic to entertain and earn income with his art there are people that are very uncomfortable around him because they don't understand how he does his illusions or how he makes the magic happen. Even today, some people are a little bit afraid of what they don't understand, or afraid of their own ignorance.
Magic has its roots in the middle east, or what was Persia, and back in earlier times magicians (or Magi) were highly educated and highly respected. They knew ancient languages, equations, secret teachings and the meanings of symbols that were handed down through generations. The general populous had no idea about these types of things and so looked up to the magicians leaders, equivalent to our MENSA society members of today.
Along with the local wise-women, who were also the midwives, the magicians usually knew a great deal about the stars, astronomy and the use of herbs and barks for healing. The world was much simpler then. To most people, it made sense that the world was inhabited by people, animals, angels, demons, witches and the devil. When the Christian church came on the scene with it's monotheistic teachings it made sense then that these inhabitants could be separated into two categories: Good and Evil or Black and White. The Good, such as Angels, certainly worked for God. The others were evil and so, were devoted to Satan.
So then, all of magic and even the practices of healing and astronomy with it, took on a "dark" connotation because the Church taught that people should look to God and his word for their needs, not to herbs and potions, or stars and magicians. Magicians, astronomers and wise-women began to be looked upon as evil and their high position in society became a thing of the past. They became outcasts, the black sheep that no one wanted to be caught being with and they were forced to move to the out-skirts of the villages and people had to sneak to see them. Often if they were caught there would be severe punishments.
With these new separations that people imposed of Good and Evil, human kind had now, unwittingly opened the playing field for one of the most pitiful times in our history, The burning times which occurred from 1550 to 1650 in Europe and is responsible for the execution of "witches" in Europe and then our own Salem witch trials in Massachusetts in the 1690's.