The Gemara writes: "Abaye said, 'The laws about sorcery parallel the laws of [forbidden labor] on Shabbos. Some of them [i.e., some acts, are punishable] by stoning; some of them [leave the perpetrator] exempt [from stoning,] but [are nonetheless] forbidden; and some of them [are] permissible in the first place....[Actions that are] permissible in the first place [are those that are] like [the actions] of Rav Chanina and Rav Oshaya, who would delve into the laws of Creation every Erev Shabbos, and a calf which was at one third of its maturity would be created from them, and they would eat it (Sanhedrin 67b, translation from Rabbi Adlersteins adaptation of Be'er HaGolah of the Maharal.)
The Maharal explains while there is certainly overlap between magic and the mysticism of the Sages, allowing for this "grouping", there is a fundamental difference insofar as magic is contravening the laws of nature while the "permitted magic"/kabbalah/ what Rav Chanina and Rav Oshaya did is supernatural but not against nature. (ibid page 37,38).