Ex Machina

''Look, it's the heroes! And they came with perfect timing...''

Whenever something or someone appears with seemingly impeccable timing, that's this. "Ex machina" or "deus ex machina" is a phrase deriving from Latin, meaning "god from the machine". It's called that because of how actors playing as gods would be brought to the stage by a crane, the machine, to solve a problem in the story that would've been otherwise unsolvable.

An Ex Machina moment doesn't always have to refer to when some person or thing abruptly appears; it can be when a fact is revealed to the story that helps the main character(s) get what they want. As an example, Guy is in jail and obviously wants out. He tries everything in his power to get out: kicking the bars down, tunneling his way out of the cell using whatever he could, and even fighting and killing the warden. But the only things that happened were him hurting his foot, not having a spoon, and getting a bullet to the arm respectively. Fresh out of ideas, Guy sits in his cell and learns to cope with the fact that he won't be getting out soon. He then falls asleep curled up in a ball of haplessness on the floor. A few minutes later, he wakes up when a guard calls for him. Asking the guard what the matter was, the guard tells Guy that he was mistaken for someone who had a similar name and was free to go home.

Examples of Ex Machina
The Amazing World of Gumball - The BFFs [Reinforced]. At the end of the episode when Gumball and Darwin are running from Fuzzy and get stuck under a tree branch they would've used to send him over a waterfall, Hank, Fuzzy's BFF from Minnesota, comes in to take Fuzzy away, saving Darwin from being squished and murdered by Fuzzy's stone. This is Reinforced for the fact that it would've been impossible for Hank to enter the river without being heard, meaning he seemingly had to teleport to the scene to play Ex Machina.