In literature, the idea of magic is used a lot. In these fictional worlds, magic exists. Logically, if something exists, then it has a physical basis. If something has a physical basis, then it must be explainable and scientifically valid. Thus, in these worlds, magic must be built upon scientifically valid principles.
The dificulty I see therefore, is in distinguishing between something that is "magical" and between something that is "technologcal". If something works by magic, why do we not say that it is working by technology? The only explanation i can give is that the word "magic" is used to describe technology that functions in a way we dont understand.
Interestingly, "magic", seems to be used as an satisfactory explanation, despite it being a total lack of explanation.
Now, imagine we have an analogous word to describe things in the real word that we dont understand. For now, i shall call this word "x", although any word would have the same meaning. So, if there is something that is unexplained, we describe it as X. Now, over time, jsut like the word magic, X becomes an explanation. Anything that is unexplainable by current knowledge is explained as X. In peoples mind, X becomes imagined as a force, because only a force could explain all things that would otherwise be inexplicable.
Some things can be explained by logical deduction from current knowledge (science). However, there is always a limit to understanding; in understanding a principle or process, a new question arises, that is, what is the reason behind the reason. This idea of limited knowledge can be expressed by the question "if x can be explained by y, how do we explain y?". Any scientific fact, no matter how vast our understanding of the universe, can always be reduced to an inexplainable principle in this way.
However, as we saw earler, X is an explanation that can be used for anything. X must therefore be an infinatly powerfull force. With X, we have a satisfying explanation for any gaps in our knowledge. This can be very comforting as it can be unsettling to be unable to explain something. Therefore, the idea of X an an opnipotent force becomes popular.