It's possible to do both, if that's your goal. Not to toot my own horn, but my The City and the Dungeon has mechanical magic from the perspective of humanity. Just wave your hands in the right way and POOF! Instant spell. This was a deliberate choice on my part, as I did not want to get into more occult magic in a YA story. It also is the choice of most other LitRPGs.
But, that said, no one understands why magic works, or where it comes from, aside from originating from the Dungeon in general. And as time progresses, it is shown that there is more to the Dungeon than previously thought...
Jack Vance did it in his Dying Earth series. The magic system had arbitrarily-imposed limits and well-defined uses and rules like a mechanical magic system, but everything else beyond that was left fuzzy and unknown, as in a mythical magic system. I'm not sure if I can write up to his standard, but if the opportunity ever arises, I might just give it a shot.