Common terms for this distinction are thaumaturgy (magic done as an extension of human will) versus theurgy (magic done through the evocation of divine power.) And there's a long, strange history within Judaism and Christianity of what we would now consider "magic" (demonology, necromancy, talismans, etc.) attempting exert direct control over others and the world. Ironically, we know such practices often involved the clergy, because many of the rituals discovered in occult books involved Latin prayers and ecclesiastical elements, and few other classes would have been literate enough to write these things down.
This brings up another axis of magical classification, between "ceremonial" magic, such as what John Dee and other "mages" were up to (think wizards and books and sacred circles and such), and "folk" magic (think witches messing with herbs in the woods), the latter of which was often elements of pagan belief carried over into a Christianized culture.
The lines between "religion" and "magic" have always been a bit blurry, and mostly a matter of culture and politics. One person's sorcery is another person's religion and so forth.
For example, alchemy and sacred geometry were deeply rooted in Christian and hermetic philosophy (themselves influenced by Platonism) - and as much about understanding God and purifying the soul as mathematics and proto-chemistry. I don't know anything about qigong but I'm just assuming the same or similar applies.
I'd suggest the Youtube channels Esoterica[0] and Modern Hermeticist[1] for some further research.
Also, we can observe that religions have survived and thrived, while 'magic' has few followers and little endurance through the generations.