Deus ex machina is usually averted through explanation or foreshadowing. But do you really need to explain or foreshadow everything that happens in your story? Is there a way to determine what needs to be told? From investigating The Dick Van Dyke Show: S3 E10 "Turtles, Ties, and Toreadors".
"Comfortable Mystery 4" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
Website: https://joshpowlison.com/