The difference between magic and miracles is very much like the difference between idolatry and true worship; by understanding this second set of opposites (idolatry vs. true worship), we can better understand the first set (magic vs. miracles).
FROM A RESPONSE TO ANOTHER TOPIC THAT I PUT UP ON THIS SITE: “ancient idolatry involves a belief that there is one God, but he’s too important, ignorant, or perpetually angry with people to be involved with them. In order to deal with this, ancient pagans, knowing that they did not have a Divinely revealed and established covenant with him, and, probably on account of the fact that they did not therein know him, or, because they rejected his true covenant high priestly representatives (such as the Hamites rejecting Shem and building the Tower of Babel), deified their kings (ancestor worship), made the sons of the deified kings into “living images” of the new “gods.” When these kings died, people believed that they could conjure the spirits of these dead “gods” (although, in reality, these were the demons, according to the Book of Enoch OR the fallen angels pretending to be the souls of dead kings, according to Catholic Tradition) into stone or wood items of worship, idols, which were also “images.” The people then offered sacrifices (signifying total dependence) to these, and inquired of them for secret knowledge or power. Idolatry is always associated, even in the Bible, with magic (the use of ritualized actions, names, incantations, in association with an idol, to manipulate reality to a desired end, rather than depending upon the True God to work for what one prays or asks Him for), animism (the propitiation and magical use of the souls that were believed to be in all things, or of disembodied spirits), fetishism, etc. Technically, then, idolatry is the worship of death itself, dead persons, deliberately against the Living God who also eventually incarnated and rose from the dead! Our faith is the fulfilment of the distorted longings of the pagans, making straight their crooked lines, as well as the ultimate antidote to idolatry! The reason I wrote this long explanation is because, knowing this, it is liberating to never again doubt the valid use of icons and statues in our parishes! The Saints are more alive than us (in the fullness of Grace, alive in the Heavenly Temple with the Living Lord, unlike fallen kings or evil spirits) and we certainly DO NOT conjure the wicked dead and evil spirits into icons or statues! And, besides, we don’t offer icons or statues actual sacrifices! lol”
BACK TO OUR TOPIC: Our Lord, as the True and only God, when working miracles, allowed his Divine Nature to manifest itself through his Human Nature (he touches, spits, speaks). The power came from his own Authority and Majesty, as a Divine Person, and from the One Shared Divine Nature that he shares with the Father and the Holy Spirit (the Spirit acted with Him, and the Father acted through Him). Whenever he used matter, such as when he spit in the mud to give eyesight to the man born blind, he never invoked any “dead” spirit within the mud, like an animist would, nor did he conjure up and place any such evil spirit into it.
You’re absolutely right, then, when you said that miracles come from God, and magic comes from the author of death, satan himself. Another important thing to remember is that magic will be limited because satan and demons are limited creatures, whereas a miracle done by God can be unlimited in power, such as the creation of the universe from nothing. Consider also the duel between Moses and pharaoh’s magicians; while they could, for example, make their staffs turn into a snake, Moses’ staff swallowed up theirs, and, later, they could no longer do what Moses was doing.
One more important note: in the ancient world, magic was at times feared but also mocked as being weak and unimpressive, or, recognized most often to be mere deception. When Jesus and the Apostles, however, did miracles, the people (many Jews even practiced magic then) were shocked, having never seen such power!