Two senses meet in the idea of a foggy mind. 恍惚 means dazed or absent-minded; 恍然大悟 means to suddenly realize, like snapping out of that fog into clarity.
Left heart radical, the side-form of 心. A hazy or suddenly clear state is a condition of the mind, so the heart radical files it among mental-state words. Same family as 怕 and 悟.
Right 光 supplies the sound — guāng drifting to huǎng. Its sense of light loosely fits the 'sudden clarity' meaning, but the main role is phonetic. The same phonetic appears in 晃.