Magic as in the tricks that are simple games is not what y he holy Quran is referring to. Rather it’s abilities through knowledge and connections with other realms that allows one to do what the average person could not do. Quran for example in the story of prophet Musa (pbuh) with the magicians says that what they did caused illusions to people’s eyes to believe that the ropes turned into snakes. Where as Musa’s (as) turned into a snake as a miracle from God. God can change the process of creating a snake from an egg to a cell evolving within the staff at a rate different to our perceived norms