The eucatastrophe does not have to be any kind of miracle at all. J. R. R. Tolkien cited an actual fairy tale, "The Black Bull of Norroway", as the example in "On Fairy-Stories." :
"Seven long years I served for thee,
The glassy hill I clomb for thee,
Thy bloody clothes I wrang for thee;
And wilt thou not waken and turn to me?"
But the reason why he heard her the third night is that after he had been drugged the first two, people asked him about all the racket of weeping and pleading they heard from his room at night, and he figured out he had been drugged, and didn't drink it. An entirely mundane explanation, even if she used magical means to reach the place and then to bribe her way into his room.
Happy endings, from the miraculous to the entirely mundane, need to be surprising and inevitable -- surprising first, and then, with hindsight, on reflection upon all the clues whose significance the reader did not grasp at the time. When the writer pulls the white rabbit out of the hat at the climax, the reader needs to remember how it was tucked into the hat in chapter 3. (That is one of the things that makes writing such a bear.) The reason why Jane Austen manages to produce a nobleman in the last chapter of Northanger Abbey to marry Henry's sister and make his father so pleased that he relents about Henry's marriage to Catherine (and to solemnly point out evidence that she hadn't just produced him) was that she had set up how fickle his father was. We had already seen him change his mind about Catherine twice on little evidence, and what little it was, was not very good.
One of the charms of re-reading is the realization of all the clues pointing the right way. For a plausible miracle, they have to be more numerous, which makes it harder to surprise people with ending, but it's not fundamentally a different process.
part of bittercon