I think there can be something else to it; Magic, in most stories, requires tremendously less infrastructure.
It takes some years of study and a short chant, say, to create a fireball.
To make a flamethrower takes some years of study, a couple of mines, thousands of people, manufacturing capability, etc.
There’s a lot more personal effectiveness in magic.
Disclaimer: I’m a mechanical engineer that spends most of my time on software these days. I can make all sorts of intersesting things, but the appeal of being an archwizard is definitely there.