Magic.
That sounds like a facetious answer, but it really isn't. When introducing the Mirror, Galadriel calls out Sam's earlier mention of "Elf-magic":
'And you?' [Galadriel] said, turning to Sam. 'For this is what your folk would call magic. I believe; though I do not understand clearly what they mean; and they seem also to use the same word of the deceits of the Enemy. But this, if you will, is the magic of Galadriel. Did you not say that you wished to see Elf-magic?'
Fellowship of the Ring Book II Chapter 7: "The Mirror of Galadriel"
Tolkien refers to this passage (obliquely) in the unsent Letter 155, when talking about the different sorts of magic in his world (emphasis his):
I suppose that, for the purposes of the tale, some would say that there is a latent distinction such as once was called the distinction between magia and goeteia. Galadriel speaks of the 'deceits of the Enemy'. Well enough, but magia could be, was, held good (per se), and goeteia bad. Neither is, in this tale, good or bad (per se), but only by motive or purpose or use.
[...]
Their magia the Elves and Gandalf use (sparingly): a magia, producing real results (like fire in a wet faggot) for specific beneficent purposes. Their goetic effects are entirely artistic and not intended to deceive: they never deceive Elves (but may deceive or bewilder unaware Men) since the difference is to them as clear as the difference to us between fiction, painting, and sculpture, and 'life'.
The Letters of J.R.R. Tolkien 155: To Naomi Mitchison (draft). September 1954
Whether the Mirror is a magia or a goetic effect, it is clear that it is produced by Elvish "magic."
The Mirror doesn't appear in any other writings of Tolkien's, and none of his early drafts of the chapter touch on it in any great detail, so this is about the best we can do.
We can make an interesting comparison to the palantíri1, also made by the Elves. Although they functioned more like telescopes than the scrying pool of Galadriel's Mirror, they could see most events anywhere in the world:
The vision of the palantíri was not "blinded" or "occluded" by physical obstacles, but only by darkness; so they could look through a mountain as they could look through a patch of dark or shadow, but see nothing within that did not receive some light. They could see through walls but see nothing within rooms, caves, or vaults unless some light fell on it; and they could not themselves provide or project light.
Unfinished Tales Part 4 Chapter III: "The Palantíri"
And Gandalf hints that they could also be used to see through time (bold is my emphasis, italic is Tolkien's):
'Each palantír replied to each, but all those in Gondor were ever open to the view of Osgiliath. Now it appears that, as the rock of Orthanc has withstood the storms of time, so there the palantír of that tower has remained. But alone it could do nothing but see small images of things far off and days remote. Very useful, no doubt, that was to Saruman; yet it seems that he was not content. Further and further abroad he gazed, until he cast his gaze upon Barad-dûr. Then he was caught!
[...]
And how it draws one to itself! Have I not felt it? Even now my heart desires to test my will upon it, to see if I could not wrench it from him and turn it where I would - to look across the wide seas of water and of time to Tirion the Fair, and perceive the unimaginable hand and mind of Fëanor at their work, while both the White Tree and the Golden were in flower!' He sighed and fell silent.
The Two Towers Book III Chapter 11: "The Palantír"
Though we don't know how they were made (except that they were made by Fëanor, Galadriel's step-uncle), it does indicate a precedence for that type of magic.
1 Hat-tip to Deer Hunter for suggesting the comparison