I will say that I think most of us are coming at this from a fairly modern perspective where we separate science and magic. If you read early modern manuscripts like Demonology in the Form of a Dialogue (1597) by James I, the speakers don't separate necromancy, sorcery, or witchcraft from the real world. It's part of the real world.
Part of the foundation of the empirical project (what is often casually called "science") was building an observational baseline of the world. The difficulty of preserving and communicating information hampered this for a very long time. As such barriers were lifted, particularly with the invention of the printing press, magic found itself driven to the edges. On the one hand, because the observations of luminaries became a lot easier to draw on; on the other, because the more outlandish observations became easier to see as...well, outlandish.
You saw a similar process start to happen in the Roman Empire before its collapse. They had inherited the notion of Ultima Thule from the Greeks, who had had extremely limited accounts of a location that is
most likely Great Britain or one of its islands. Ultima Thule was supposed to be quite fantastical, and the Romans expected to see such things when they conquered what we now call England. But since they found none of that, they assumed that this was just a
mistaken attribution, and that the
real Ultima Thule must be further north--ever further, since no matter how far north they sailed they didn't find it. But now we've sailed the whole world; we've removed any "edges" from the map. There is nowhere left for Ultima Thule to be.
Magic and "science"
were ultimately the same thing, an attempt to leash the powers of existence to the human will. "Science"--empirical study--flourished because, y'know, it actually works, more or less.* Magic only fell by the wayside because it ended up being actually ineffective when put to proof...and as all the snake-oil salesmen and "breatharians" and the like demonstrate, it never truly
died, it just went underground. The siren song of "if you find out The Secret, you can have control" is too tempting for most folks to ignore, though the vast majority of it lies in very mundane things (like "jinxing" something by speaking about a bad possible event before it might occur).
*Not calling into question the overall success of modern science, but rather that individual
studies are a lot less reliable than I'd like. The replication crisis in psychology, for example, or known issues with p-hacking and other dubious activities. I did a report on the issues with peer review and the status of scientific claims in the public eye, and predicted that things were about to get
really really bad if scientists didn't start owning the narrative and addressing the mistaken image they and others had built. Naturally, what I recommended didn't happen...and most of what I feared did, in ways worse than I could have imagined.