Dates from ancient Greek times, where "
deus ex machina" ("god from the machine") in a play referred to the act of lowering a god on stage using
a cable device (therefore, a god from a machine) to decide in a dilemma and give fate a nudge, so to say.
These days, deus ex machina has the negative connotation of an utterly improbable, illogical or baseless
plot twist that drastically alters the situation, as if the "deus ex machina" came down to give fate that little push.
I liked the movie, but the ending was
total crap...they could've come up with a better way to beat the villain than
the deus ex machina ending of that guy miraculously coming back to life.