Deus ex machina: a person or thing (as in fiction or drama) that appears or is introduced suddenly and unexpectedly and provides a contrived solution to an apparently insoluble difficulty.
Deus ex machina is a storytelling technique used to depict situations in which something (whether a character, object, or event) from outside the developing narrative is brought in to solve a sticky problem or conundrum. It refers to the sudden and unexpected emergence of a solution to an apparently intractable situation.
It is a Latin phrase which translates to “God in the machine,” derived from a Greek drama wherein a man costumed as a God would be hoisted onto the stage by a crane (machine) in order to neatly “tie everything up.” Aristotle was the first person to employ a Greek expression akin to the Latin phrase “deus ex machina,” but it was the classical Greek dramatist Euripides who is credited with popularizing the method.
This plot device’s primary function is to bring everything to a satisfying conclusion; however, it may also be used to generate laughter or to bridge a gap in the story’s progression. Some opponents maintain that in order for a given scenario to be considered a deus ex machina, it must be wholly unforeseen and appear out of nowhere. Other terms that could be used interchangeably with deus ex machina include “contrivance,” “gimmicky coincidence,” and “divine intervention.”
The occurrence of a deus ex machina in a story is seen as problematic for a number of reasons, not the least of which is that it is an essentially meaningless plot device that may undermine an otherwise compelling narrative. It is often seen as negative in writing because it casts doubt on the veracity of the whole narrative when it is used, and frequently suggests a lack of creativity on the part of the author.
On the other side of the coin, the introduction of an unexpected new event or character intended to guarantee that things suddenly turn considerably worse for the protagonists or become much better for the villains, or both, is known as “diabolus ex machina” (devil from the machine).
Deus Ex Machina by Amanda Headlee, The Sarcastic Muse
Deus Ex Machina in Your Novel by Mason Sabre, Medium
Deus ex machina — a controversial literary device by Peter Rey, peterrey.com
Deus Ex Machina: What it is, Why it’s Bad and How to Avoid It by Graeme Shimmin, graemeshimmin.com