Loosely translated from Latin, "deus ex machina" means "God from the Machine." In dramas written in ancient Greece it was a common technique used to resolve the play's conflict.
Oftentimes heroes such as Hercules would face overwhelming odds. Audiences might think, "The hero is sure to be slaughtered. There's no way he can possibly get out of this mess!" Then, Zeus would show up at the end, saving his son from certain doom. Sometimes "deus ex machina" was used to allow characters to escape their crimes. In the gruesome tragedy Medea, the title character murders her own children. However, before she can be punished, Helio's sun chariot swoops down and she flies off into the sky.