What is evident about YHWH from at least as far back as the Abraham-Isaac story, is that He is perfectly comfortable disturbing the narrative from without. God’s last minute substitution of a ram for the son shows that there are rules to be followed, and an economy of sacrificial exchange by which mortals are expected to play, and even in some sense, by which the universe appears to be governed, but also that there is a god-term ready to disrupt the agreed upon rules of the game by obliterating the market itself.
The scriptures both Jewish and Christian show this again and again as the three in the fire are not burned, as the lion doesn’t eat Daniel, even the rules of physics are suspended as walls crumple from the pressure of trumpet blasts. If all these interventions prepare God’s people for one huge and unlikely substitution at Good Friday—just after the messiah disturbs the sacrifice exchange market within the narrative—it also invents a kind of theater. The world as we had been experiencing it with predictable rules and consequences for action is shown to be a kind of dumb show in which the divine can call curtain at any time, and in which he can interfere, introducing new characters and plot elements however nonsensical they may seem to the players already onstage, for the purposes of salvation.
Here is a theatrical device that Shakespeare adapts to his uses in several plays. While it can sometimes seem mawkish to a narratively sophisticated audience, the sorts that engross itself in hours of binged and packaged narrative content, he’s not only taking the short route to a happy ending, but saying something about the nature of reality: that God’s way is true. She was a boy all along! Portia wasn’t really dead! are just the sorts of ending for which his plays are sometimes criticized, but they are meant to be realistic rather than magical, if we count reality to be that higher framework within which what we take to be the real is enclosed.