Phonosemantic compound. 彗 represents the sound and 日 represents the meaning. Based on the original meaning "to scorch". The current meaning is a phonetic loan.
習 and 彗 don't sound similar in modern Mandarin due to historical phonetic changes. They were more similar in older Chinese.習 /*s-ɢʷəp (with root *ɢʷəp ‘wing’?)/ 彗 /*s-[ɢ]ʷe[t]-s/
Due to historical stylistic changes, this component is less similar to 彗 than it was in ancient scripts.