Deus ex Machina

A deus ex machina is a plot device, commonly used when an author has written themselves into a corner. It is a way to "save the day" by random, often by magical or pseudo-magical means. For example: Our heroes are trapped in the last room of a keep, hordes of bloodthirsty orcs pounding down the door, with a dragon roasting the stones around them. Suddenly, God whisks them away to a magical island paradise. Tolkien's Great Eagles are often accused of being dei ex machina, due to their habit of showing up exactly when needed. Dei ex machina are also often used by 'Sues.

The term deus ex machina literally means god from the machine, and refers to Ancient Greek plays, in which one way of resolving insurmountable problems was to have a god appear through a trapdoor or descend on a winch and clear everything up.