One of the better discussions of the failed Battlestar Galactica finale (at Tor.com) included a link to a decades-old piece from Ansible, "The Well-Tempered Plot Device," which gets at what went wrong with the show as well as any other commentary I've seen.
Sometimes, however, even the Universal Plot Generator breaks down. You may find, in the course of hacking forth your masterpiece from the living pulp, that none of the plot devices hitherto catalogued, none of these little enemas to the Muse, will keep the story flowing; that you can think of no earthly reason why the characters should have to go through with this absurd sequence of actions save that you want them to, and no earthly reason why they should succeed save that it's in the plot. Despair not. If you follow the handbook, you'll find there's a plot device even for this -- when the author has no choice but to intervene in person.
Obviously, this requires a disguise, unless you're terribly postmodernist. The disguise favoured by most writers, not unnaturally, tends to be God, since you get the omnipotence while reserving the right to move in mysterious ways and to remain invisible to mortal eyes. There aren't all that many deus ex machina scenes where the Deity actually rolls up in person to explain the plot to the bewildered characters, though Stephen Donaldson permits an extended interview at the end of The Power That Preserves. What tends to happen instead is the kind of coy allusiveness coupled with total transparency of motive you meet, for example, in The Black Star, where our heroes most improbably find a light aircraft in which to escape the overrun city:It was by the most incredible stroke of fortune that Diodric and the Lady Niane should have stumbled upon so rare and priceless a memento of the eons. Or perhaps it was not Blind Fortune, but the inscrutable Will of the Gods.One thinks irresistibly of Gandalf's famous words to Frodo when explaining the logic of The Lord of the Plot Devices: "I can put it no plainer than by saying that Bilbo was meant to find the Ring, and not by its maker." Frodo, unfortunately, fails to respond with the obvious question, to which the answer is "by the author".
But actually, it's not always necessary for the author to put in an appearance himself, if only he can smuggle the Plot itself into the story disguised as one of the characters. Naturally, it tends not to look like most of the other characters, chiefly on account of its omnipresence and lack of physical body. It'll call itself something like the Visualization of the Cosmic All, or Seldon's Plan, or The Hitch-Hiker's Guide to the Galaxy, or the Law, or the Light, or the Will of the Gods; or, in perhaps its most famous avatar, the Force. Credit for this justly celebrated interpretation of Star Wars belongs to Phil Palmer; I'd only like to point out the way it makes sudden and perfect sense of everything that happens in the film. "The time has come, young man, for you to learn about the Plot." "Darth Vader is a servant of the dark side of the Plot." When Ben Kenobi gets written out, he becomes one with the Plot and can speak inside the hero's head. When a whole planet of good guys gets blown up, Ben senses "a great disturbance in the Plot."