Two magical fantasy quests, decades apart. Both rocked the literary world, but each in its own way. The two authors who created these masterpieces of magic actually demonstrated how versatile magical worlds can be, and that includes the various ways of presenting the magic that governs them.
It's easy, of course, to recognize the similarities in J.K. Rowling's and J.R.R. Tolkien's treatment of magic. Both the seven-book Harry Potter series and The Lord of the Rings trilogy are magical fantasy quests, with clear-cut lines between good wizards and evil. There is even a scene in Harry Potter and the Order of the Phoenix that strongly resembles the epic battle between Gandalf and Saruman. Like the wizards of the Ring trilogy, Albus Dumbledore and Lord Voldemort battle it out in a spooky magical setting located within the halls of the Ministry of Magic without input from Harry, just as Gandalf and Saruman seemed to have no need for Frodo when they challenge each other at Isengard.
In both cases, the reader is treated to a man's fight, in which the young heroes have no place. It serves to demonstrate just how much trouble Frodo and Harry are in. The literary use of magic in the two series is an interesting point of comparison, however, not because of the similarities, but because of the differences in the approach of each author.
For instance, Lord of the Rings, being told from the point of view of a non-magical person, treats magic as something exotic. The reader doesn't come across magic very much at all in the first part of the tale, though the frequency of magic use and of encounters with magical creatures and beings increases as the story goes on. This is, of course, because magic seems to be used only in dire circumstances, which increase in frequency as the Fellowship and the reader draw ever closer to Mordor.
Harry Potter, on the other hand, is told from the point of view of a magical character. In Harry's world, magic is commonplace, and crops up in the most unexpected of situations. Women use their magic to cook and clean. (Sorry girls – male wizards apparently don't wash up or cook. So don't marry one unless you can afford house elves.) The reader gets an intimate peek at the curriculum and classroom goings-on at Hogwarts School of Witchcraft and Wizardry. Of course, as the story progresses and the situation grows more dire, the magic becomes combative like the magic in Lord of the Rings.
Rowling has followed in Tolkien's footsteps by creating a fantasy series that will redefine the genre for a whole generation, and probably many more generations to come. However, the fact that the Harry Potter audience identifies more with the wizard than did the Ring trilogy audience is an interesting point, which probably says something profound about how the reading public has changed over the decades since Tolkien's trilogy was first published.