Arthur Clarke is usually credited with saying that a sufficiently advanced technology is indistinguishable from magic. I think it may have been Larry Niven (I am too lazy right now to look it up) who came out with the the corollary, that any sufficiently rigorous magical system is indistinguishable from technology. I personally do not even try to distinguish between them. To me, it's all semantics.
The way I look at it, if you understand what, how, and why, then it's science. If you understand what and how, but not why, then it's an art. If you understand what, but not how or why, it's magic. Gunpowder used to be magic in Europe. Until people figured out how to mix it up for themselves. Then it became part of the Art of alchemy.
Alchemy is the perfect example. To many people in Europe, alchemy was magic, pure and simple. White magic or black magic, depending on who you asked. But magic. To the alchemists themselves, it was The Art. They knew what to do, and how to do it, in order to make some things happen. They had even started to figure out a few basic rules and principles. But still, they didn't know why some thing happened in certain ways when you mixed certain earths in particular proportions. They just knew that they happened. Even in the 18th and early 19th century, people who called themselves chemists were, in many cases, operating by guess and by gosh with their fingers crossed. Finally, people started learning about molecules. Light began to dawn, and alchemy became the science of chemistry.
Medicine is another prime example. Up to the nineteenth century, tribal healers in rural areas often used herbal remedies that were sneered at by European doctors and their colonial offshoots. In both cases, the healers, tribal and Euro, were practicing an art rather than a science. Neither of them had a clue as to why some people got sick and others didn't, or why some people got better and others didn't. The difference was that in many cases the tribal healer was more adept at the art and, instead of acknowledging this, the city dwellers sneered at the tribal healers art and called it magic. Thereby shoving it into irrelevancy.
Then that pesky French guy, Pierre Louis, had to ruin things by proving statistically that the time honored and slmost universally revered tradition of bloodletting was not just useless. It was killing people. Shock and dismay ensued. What?! One of medicine's most cherished rituals, one that had been practiced for an unholy number of centuries, was actually mere superstition?! Blasphemy!
Ignaz Semmelweis later proclaimed that if doctors and nurses washed their hands, it would keep disease from spreading. If I am not mistaken, there is something about ritual cleansing after handling sick people and such in a book called the Old Testament. Since the ancient Egyptians are reported to have successfully conducted trepanning, oral surgery, amputations, and cured a variety of communicable diseases, I suspect a lot of this had been well established as part of the medical Art for a while. But Europe got ethnocentric for a couple of millennia and preferred to use traditional magic. While the tribal healers were in fact practicing an art. It wasn't until somebody started processing the data with numbers that it all turned into a science.
You know, like him or hate him, Robert Heinlein was right about one thing. If it can't be expressed in numbers then it isn't science. It's an opinion. The corollary of course, is that if it can be expressed in numbers, then it is science. Not art or magic. If someone makes a categorical statement, and cannot show the numbers to back it up, they are chanting an incantation.