What we read in Harry Potter books isn't science fiction & related fantasy. So, why do moderators allow these type of questions?
This site decided some time ago to accept any form of Fantasy, not merely those related to Sci-fi. While there is still a bit of sci-fi bias in the site (Most principally, the domain name), and while there is far more sci-fi than fantasy, fantasy is on topic, period. See Is Fantasy in spec for this site? , Should we change the name of this site to include fantasy? , When should we change the name to include fantasy? . It was also discussed on Area 51, but that topic has since been deleted, probably because it didn't link to any open proposal, they all got moved here.
Let's go to our good ol' friend Wikipedia to see how do they define fantasy:
Fantasy is a genre of fiction that uses magic or other supernatural elements as a main plot element, theme, or setting. Many works within the genre take place in imaginary worlds where magic and magical creatures are common.
So now breaking it down for Harry Potter:
- Uses magic as the main plot element (✓)
- Shows magic in the world(✓)
- Has magical creatures(✓)
So this establishes that Harry Potter Series indeed belongs to Fantasy genre and therefore is on-topic here. That's why Questions about HP are on-topic here and as it happens, it is among the top three tags on this site.