What does the phrase "deus ex machina" mean?
The Latin phrase "deus ex machina" means god (deus) out of (ex) a machine (machina). It refers to a common form of staging in Greek tragedy in which a crane was used to lower an actor into a scene so that the actor appeared almost to be flying. Gods, in particular, because they were supposed to be descending from Mount Olympus often made entrances via a machine.
In terms of plot structure, often dilemmas in the plots of tragedies (especially those by Euripides) were solved by having a god descend from a machine and resolve the plot by fiat; thus colloquially the term deus ex machina refers to a contrived or artificial ending in which some outside force or power imposes a solution rather than the resolution flowing organically from the characters and situation.