Note: As with my previous post, this post contains spoilers for those who haven't read the complete Harry Potter series. Proceed with caution.
The Messiah figure is quite common in literature...and particularly in the genre of science-fiction and fantasy. One reason for that is, in the world of science fiction and fantasy, unlike other more "realistic" genres, coming up with a way to have a character die and come back to life is easier. It simply takes a bit of magic or whatever.
But not all Messiah figures are created equal. Take The Matrix. Neo is, undeniably, a Messiah figure. He was "prophesied" as being "the one" (and even his name is a anagram of this). And, at a key moment in the movie, he dies. Only after his death and subsequent resurrection does he have the power to defeat the agents that led to his death.
And despite later symbolism, such as Neo's "ascension into heaven" at the very end of the movie, and his ability to raise Trinity from the dead in the second movie, Neo, as a true Messiah figure, kind of falls flat. Nothing leading up to his death and resurrection really can make him like Jesus Christ.
In Lord of the Rings, we have Gandalf, and his death and eventually resurrection as well, after dueling the "demon". But, again, his role as "Messiah figure" is limited. He, ultimately, isn't the salvation of all...but merely salvation of some of his friends. Of course, Tolkien didn't set out to write allegorically.
Harry Potter is different. While he, too, was prophesied as the one who would save the wizarding and muggle worlds, and while he eventually dies and comes back to life (in a sense), he is a stronger representation of the true Messiah, Jesus Christ. Why?
First, the true Messiah was a model of perfection. He lived a perfect life. This was key, because in order for him to be the final sacrifice for all, he had to be the "spotless lamb" that God had required of the Jews for generations. And while Harry wasn't exactly perfect, what is clear is that he, unlike even Dumbledore before him, approached his role as "savior" with a pure heart. He was never seeking anything for himself. He was seeking truth. Repeatedly, Dumbledore admired Harry for his pure heart, his ability to love, and the love that was shown to him through his parents. He was able to secure the Deathly Hallows because he wasn't, as was the case of Dumbledore, seeking to raise himself up as powerful. He wasn't proud.
And it was this very quality that made it possible for Harry to defeat death, and ultimately, Voldemort.
Harry also had his "disciples" prior to his death, including friends Ron and Hermione, as well as others. But he also had his "pharisees". The kids (and grown-ups) who despised who he was. The Malfoys, for example.
As the Messiah figure, Harry ultimately defeated death, "Satan" (in the form of Voldemort) and brought about a "heavenly kingdom"...that is, a wizarding world that no longer had to live in fear.
Now, the figure I find more complex in is Dumbledore, so I'll attack that another time.