I think you’re right that her humor is one advantage she has over many of the other writers she’s foten compared to. And what impresses me is that her humor for the most part doesn’t sacrifice believability. That is, unlike Adams or Asprin, when there’s something funny, it’s usually the characters within the story trying to amuse each other (the way real people do) rather than the author trying to amuse the reader.
A couple of the other reasons for Harry Potter’s popularity (that don’t really say anything one way or the other about her literary quality):
(1) They are, in some sense, mysteries. They keep their readers guessing by giving them big questions to wonder about (e.g. Who keeps trying to kill Harry? Who is the “Half-Blood Prince”?) and are sprinkled with hints, clues, red herrings, and big reveals and the end. So it didn’t really surprise me when she later turned to writing “actual” mysteries.
(2) People want to go to Hogwarts (at least vicariously). The local newspaper sometimes publishes Q&A interviews with local teens, asking (among other things), “If you could live in a book, which would you choose?” and Harry Potter seems to be the most common answer. I’m convinced that a large part of Rowling’s success is that she’s created a world that readers want to spend time in.