So I was watching a show last night, the Star Trek where Sisko asks the Bajoran prophets to stop his enemies and they do. I had a question about how things worked out, so I looked it up online. Turns out, it was accused of having a deus ex machina ending. Now that sounded familiar to me, but I couldn't quite remember what it meant, so I looked that up too.
Deus Ex Machina
The term has evolved into a plot device whereby a seemingly unsolvable problem is suddenly and abruptly resolved by the contrived and unexpected intervention of some new event, character, ability or object. (From Wiki)
A character or thing that suddenly enters the story in a novel, play, movie, etc., and solves a problem that had previously seemed impossible to solve. (Webster's)
In ancient Greek and Roman drama, a god introduced into a play to resolve the entanglements of the plot. (Dictionary.com)