Magic is an unstable, supernatural force wielded by members of various species, most notably the Dire Wraiths, to alter reality to a degree.
It can however be defeated with sufficiently advanced science.
The Wraith Sorcerers could use their magic to perform a variety of feats such as teleportation, telepathy, and the ability to conjure forcefields. Their magic allowed them to infect and assimilate other lifeforms allowing them to assume their form. Though the procedure worked flawlessly on organic lifeforms, an attempt by a Wraith Soldier to assimilate the Autobot Sky Blast turned both the Wraith and the Autobot into an out of control Wraith/Cybertronian hybrid. Once the hybrid's energies caused it to combust, Vekktral wondered if Wraith magic might work better on mechanicals of similar stature to the Wraiths.
A mysterious ore of unknown origin enhanced the natural magic of the Dire Wraiths and they invaded Elonia to try and obtain it despite it being lethal to them. Their invasion was unsuccessful and resulted in the birth of the Space Knights. After the Dire Wraiths had gone to war with the Solstar Order, their science proved superior to the Wraiths' dark magic. At roughly the same time, another group of Wraiths discovered Ore-13 on the planet Earth that had near-identical effects on Wraith magic as the Elonian ore. Its enhancing effect was such that the Wraiths could conceal themselves from a Knight's Energy Analyzer.
Human science fiction author Arthur C. Clarke wrote that "any sufficiently advanced technology is indistinguishable from magic". After studying the Talisman however, Garrison Kreiger came to believe that magic was the true power of the universe with all technology being an imitation. Joe Colton dismissed magic as unexplained science prompting Kreiger to quote Clarke's third law.
After the humans became more aware of the Dire Wraiths, they published several texts regarding magic on the internet. When the command staff of both G.I. Joe and the Autobots were occupied on Cybertron, the Wraiths sought to consolidate their power over Earth and used their magic to alter the biology of several insects, turning them into carriers of a virus. The magic was so unstable however that it burned through the organic hosts.
There was no magic in Microspace leaving the Micronauts unprepared for it when they confronted a duo of Wraith Sorcerers. To thwart the Wraiths' plans, the Micronauts sought out Rom for his expertise on the arcane.