the reasons for the odd popularity of the book franchise back in the day
there's nothing odd about it
it's a, for the most part, competently written children's mystery book set in a magical boarding school
the entire premise is inherently appealing to pre-teens
then the author got lucky and the book became a best-seller in england
then she was also lucky to release the book at a time when one of the hottest issues of european public education systems was having kids fucking read books
so the books got included in school reading programs
which led to further success
success that resulted in a movie adaptation
and the movie was a smash hit, which further inflated her success to essentially world wide popularity
then she was smart enough to recognize that the bulk of her audience were teenagers and first books more childish tone wouldn't be as "engaging" with them
so from books 4 to 7, she shifted to a more teenager soap-operas style (while keeping the fundamental appeal of mystery set in magical highschool)
thereby not only retaining that main audience that "grew" with the first book, but also expanding her setting's appeal to teenagers in general