Analysis: What's Up With the Ending?
So, there are two endings to this book – the close of the Harry-Voldemort plot arc, and then the epilogue, which takes place nineteen years later.
Harry's Death Scene
First of all, everything we've been wondering about over the course of the last seven books comes to a head in the final confrontation(s) between Harry and Voldemort. The beginning of the end comes when Harry realizes (through Snape's memories) that his destiny is to die (well, shoot). This seems to answer the question everyone's been asking, especially since Book 5, The Order of the Phoenix, when it was revealed that either Voldemort or Harry will survive: will Harry die? Seemingly, yes.
However, things aren't always as they seem. Harry struggles with getting ready to die, and becomes firm in his resolve to sacrifice himself for the good of the whole world – and that's the important thing, apparently. He basically offers himself up to Voldemort, and it's this act of sacrifice, which is a parallel to what his mother did for Harry himself) that saves everyone.
(Spoiler alert! Well, I guess we're already past that…) Harry doesn't actually die, though; instead, the part of him that preserved a segment of Voldemort's Horcruxed soul dies, and Harry, Voldy-free, is reborn. It's Harry's death and purified rebirth that everything hinges upon here – Harry's been a savior figure all the way through (you know, the Chosen One, the Boy Who Lived, and all that), and now his "death" to save humanity makes the whole Christ-like aspect of his destiny even more clear. Religion has otherwise been carefully absent from the Potter books as a whole – Christmas happens every year, but seems only to have holiday-spirit ramifications for our wizarding friends – and so it's unclear what we're meant to make of this parallel. We'll just leave it at that for now… read into it as much or as little as you like.
So, OK, Harry saves humanity through his willingness to sacrifice himself. Well, then, what's a guy to do after he accomplishes his destiny by saving the world as we know it at age seventeen? Here's where the second ending jumps in. We see Harry, Ginny, Ron, and Hermione sending off their kids on the Hogwarts Express nineteen years later (nineteen years later because, according to Rowling, she doesn't want to promote teenage pregnancy! [source]).
It's this scene that offers us the reassurance that Harry really did succeed – the fact that we're left at good ol' Platform Nine and Three-Quarters, where the magic really began back in Book 1, means that Harry actually did manage to preserve the world as we know it – and, furthermore, to make it slightly better. The enmity between the Houses of Hogwarts is something that Harry and his peers are trying to put in the past; when Harry tells young Albus Severus not to worry about being Sorted into Slytherin, we catch a glimpse of the equal, unprejudiced, and unsegregated world that Harry's trying to make. In the end, everything's as it should be, finally. Whew.
The Last Word
Before the release of Deathly Hallows, Rowling said on numerous occasions that the last word of the book was "scar." But, you might have noticed, that's not actually how it ended up in the printed version. The last words in your book are "all is well." What happened? Here's what Rowling had to say in a 2007 interview:
For a long time the last line was something like: "Only those who he loved could see the lightning scar." And that was in reference to the fact that as they were on the platform, people were milling around. And that Harry was kind of flanked by, you know, his loved ones. So they were the only ones who were really near enough to see it, even though peo– other people were looking. And it also had a kind of ambiguity. So it was – is the scar still really there? But I changed it because I wanted a more – when I came to write it, I wanted a very concrete statement that Harry won. And that the scar, although it's still there, it's now just a scar. And I wanted to say it's over. It's done. And maybe a tiny bit of that was to say to people, "No, Voldemort's not rising again. We're not going to have Part Two. Harry's job is done." So that's why I changed it [to "all is well"]. (source)
So the last words leave us with the feeling that, though Harry's world has been torn apart by war, eventually the community is able to rebuild itself even stronger.