Hats a) keep away prying telepathic aliens if you line them with foil, b) cover that bald patch c) if they have earflaps they can keep away the sounds of screaming !$%*!$%*!$%*!$ eejits (see JD) d) look cool if you a are a jazz musician e) denote rank besides being rank f) protect from God which is why they are obligatory in some societies.