(31) Do not turn to ghosts and do not inquire of familiar spirits, to be defiled by them: I am ה' your God.
(י) לֹֽא־יִמָּצֵ֣א בְךָ֔ מַעֲבִ֥יר בְּנֽוֹ־וּבִתּ֖וֹ בָּאֵ֑שׁ קֹסֵ֣ם קְסָמִ֔ים מְעוֹנֵ֥ן וּמְנַחֵ֖שׁ וּמְכַשֵּֽׁף׃
(10) Let no one be found among you who places a son or daughter into the fire, or who is an augur, a soothsayer, a diviner, a sorcerer,
Sam: Jews can do magic because it is not really sorcery. Necromancy is what is really forbidden because we are not supposed to worship the dead or get advice from them
Do Jews believe in magic?
BY MY JEWISH LEARNING
Judaism has had a long and tenuous relationship with magical beliefs and practices. .....
Yet in other biblical contexts, practices that would seem to be similarly questionable — interpreting dreams, using magic staffs, reciting blessings or curses, and referring to oracles — figure prominently as suitable behaviors for Israelite heroes. Moses and Aaron, for example, are celebrated for performing tricks that the Egyptian magicians could not match. The supernatural actions of Israelites–whose source of power is God–are welcomed; the actions of outsiders–whose power comes from sorcery–are derided.
Ben - G-d gave the magicians of Egypt just a little bit of his power so they could get their confidence up that they could do what G-d could do. But then G-d showed them that their powers were not really as powerful as G-d's and they could not do what G-d was able to do after that. G-d built up their confidence so that they thought they had more power than they really did.