Any sufficiently advanced technology is indistinguishable from magic.
Third Clarke’s law. Many fantasy worlds where magic is real often have a “technological” backgroud: Mystara, Shannara and also Athas (in its pecualiar ways) have ancient, technological socities…
Also all D&D magic system is built upon the assumption that magic is “just” or “somehow” misunderstood technology See “The Implied Apocalypse of Dungeons & Dragons“.
Regarding Athas, I won’t spoil your surprise…