Since it’s not necessarily a commonly understood term, let’s define deus ex machina right away.
According to my go-to resource, Dictionary.com, a deus ex machina – pronounced “dey-uh-s eks mah-ku-nuh” is:
(In ancient Greek and Roman drama) a god introduced into a play to resolve the entanglements of the plot
Any artificial or improbable device resolving the difficulties of a plot.
Or consider this definition from the University of Vermont:
This Latin phrase originally described an ancient plot device used in Greek and Roman theatre. Many tragedy writers used Deus ex Machina to resolve complicated or even seemingly hopeless situations in the plots of their plays. The phrase is loosely translated as “god from the machine.” This translation refers to how the Deus ex Machina was often performed in ancient theatre. An actor playing a god or goddess would be lowered on stage by a “mechane,” which was the name of the crane device used.
So basically, it’s a literary miracle that makes everything else fall into place in an otherwise impossible story scene. Everything’s going horribly for the protagonist in particular or the good guys in general, and there’s no realistic chance whatsoever that things will change for the better.
Except that, all of a sudden, that’s exactly what happens.
Typically, inexperienced (or tongue-in-cheek) writers whip them out during climactic moments. So we might have a protagonist – let’s call him Xavier – in the middle of a battle that’s looking more and more grim.
Among the troops he should have been relying on, his left flank has fallen, his center is failing fast, and the reinforcement troops from the neighboring country of Vactron have sent word that they have a really bad stomach bug and are delayed indefinitely.
Worse yet, Xavier already has blood pouring down his right arm from a deep sword gash, and one of his ankles is probably sprained as he tries to circle, parry and dodge against his worst enemies forever (WEF), Quagdar, who’s grinning at the easy kill he sees coming any second now.
When suddenly, out of nowhere, a little pink fairy shows up and bites Quagdar on the nose, making him howl in surprise and let down his guard just long enough for Xavier to run him through.
Seeing their leader crumble like that, the rest of the enemy troops fall into chaos, and the battle goes to the good guys after all. And they all lived happily ever after.
Okay, that’s a really extreme example of an already extreme literary definition. But hopefully you get the point.
While a deus ex machina definitely fits more conveniently into the climactic moment, creative writers can employ the tacky things into their falling action sections as well. With perhaps too many loose ends to wrap up nice and neat, they get frustrated or panicky or lazy, and explain something away with what comes across as flippant ease.
Oh, that little detail doesn’t want to fit? Fine then! I’ll just have a literary miracle explain it away! Secondary Character 7 will have an off-page epiphany that has her giving back the silverware even though she never gave any prior indication of changing her mind.
But here’s the bottom line: Employing a deus ex machina for the climactic moment is lame. And the same is true in the falling action.
Unless you’re deliberately trying to be silly, you want to work out your plot points some other way – perhaps even with careful consideration, logic and something more realistic than a god from the machine.