In a setting I am building for a D&D campaign, the planet (named Amalthea) has two moons, Rhea and Namaka. Rhea appears a little larger and slightly redder than the Moon, and Namaka appears in about half of the size of the Moon, and is somewhat blue in color.
Namaka, though, is in fact an artificial moon, and is the source of magic on Amalthea. (Its coloration is due to its surface being entirely covered in solar panels.)
The way magic works in this setting is simple. Mages use their hand gestures and such to interface with computer systems located on Namaka via its omniscience scanner array, and command the planet's omnipotence beam array to create the desired effect. (Planar locations are in fact just VR suites located onboard Namaka, or something like that.)
Although it's not quite that simple - directly controlling the omnipotence beam array is impossibly difficult to do by hand, so mages rely on layers and layers of poorly-documented and poorly-understood subroutines and APIs accumulated over years of different mages adding and tweaking things. When mages prepare their spells, they are creating bindings between their verbal/somantic/material components and the desired API calls and parameters.
So basically, magic works just the same as it does in every other D&D setting, the main change being that the magic goes out every time Namaka gets eclipsed, as well as providing a plot point later when Namaka is eclipsed for an extended period by Amalthea and then Rhea, depleting its backup power supplies and triggering a complete system reset.
The thing I am trying to figure out, is what Namaka's original purpose was, since "let people hurl fireballs at other people" almost certainly wasn't it. After all, a civilization that could build such a device would probably find fireball-hurling redundant with whatever weapons they already had.
Why would the original builders of Namaka have constructed it, to outweigh the enormous cost of doing so?