I didn’t come up with this theory, but I read somewhere that the Sorting Hat appears to sometimes take into account not only the qualities the student already has, but also the areas where they could use encouragement and places them accordingly. This would explain why say, Hermione is in Gryffindor instead of…