Deus ex machina ("god from the machine") is a plot device where an unexpected, unlikely event or character resolves a seemingly impossible situation in a contrived manner. Often criticized as unrealistic and lazy, it undermines narrative credibility by disregarding established logic.
When employed creatively and sparingly, it can provide ironic twists, humor, or commentary on life's unpredictability and human limitations.
Recognizing this device is key to critical analysis of narrative construction and reader experience.