Spoilers abound, but this should be apparent at this point. I'm not gonna bother marking them.

At this point, I feel like I should have seen it coming. It, of course, being a terrible deus ex machine ending relating to the nature of magic as poorly defined by Rowling. I know enough of fantasy at this point to say that basing the limitations on what magic can't do is asking for trouble. It leaves the writer with a the means to explain away an awful lot of problems.

The thing is, Rowling wrote herself into a bit of a corner, and it's awfully tempting to explain away problems with such a blanket excuse. "The relationship between body and soul is unexplored magical territory, Harry! Nobody could have predicted what would have happened!" certainly explains away the need for more than the barest of foreshadow (really all we got was the famous gleam in Dumbledore's eye at the end of The Goblet of Fire). If nobody could have seen it coming in the diegesis of the novel because magic isn't so well understood, why should the reader, especially when Rowling likes to play a fairly unreliable narrator.

That said, the opposite isn't much better. Gandalf in The Lord of the Rings is quite possibly the most powerful being in Middle-earth; he is, like Sauron, a demi-god of sorts, after all. Yet his power is not properly defined in the series, and it's only through the Silmarillion and Tolkien's notes that we ever learned what exactly an Itsari is. He's the stereotypical (although Tolkien is responsible for a great many of our fantasy genre stereotypes, so I can't fault him too much for it) old mentor with boundless magical power. He's an example of what happens when an author resists the temptation to use a deus ex machina as a cure-all to the problem, and it's result isn't much better. There are plenty of times with Gandalf and characters like Gandalf where one wonders, "Why the hell didn't he just use his power to fix it all right away?" Gandalf's excuse isn't strictly explained in the Lord of the Rings, but from what I understand, he and the other Itsari were forbidden to use their powers to explicitly aid the inhabitants of Middle-earth. Rather, they were meant to be guides.

In either case, the reader is often left with a strong sense of, "Well, that was lame." As such, I generally think defining magic by what it can do as opposed to what it can't can avoid both situations entirely. Unfortunately, Rowling did the exact opposite and we ended up with The Deathly Hallows. I didn't mind at first. I was too busy being annoyed by the atrocious epilogue. I don't really care much at this point, though, since the whole series basically led itself up to that one giant moment of let-down. Should have seen it coming.

Still liked the book as a whole, though.