@KindergartenKop
I think they're so popular because they contain literally every element of literature that feels good, entertaining, comforting, inspiring to read:
a relatable protagonist, an alternate world that isn't totally different from our own (unlike LOTR or Narnia), suspense/mystery, mythology/folklore, boarding school drama, strong moral lessons (friendship, love, sacrifice) and spiritual overtones without direct preaching, dealing with grief/trauma/loss/death, loads of humour, an epic story with lots of clever plot-building and foreshadowing, twist endings in every book, and so much more! It's like going to a buffet that serves every variety of food that you love.
Having lost many loved ones during this terrible past year, re-reading the HP books has brought me comfort, solace and joy even as an adult. They never get old, no matter how many times I read them. The films are terrible in comparison, missing all the subtleties that make the books so great and instead focusing on crowd-pleasing action-movie type themes.