Why do people get dandruff?

Complex. It's the interaction between several hormones, one's own skin biology, and the pityrosporum yeast. It has nothing to do with poor personal hygiene. Fortunately, it is usually easy to manage. Good luck.