system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What exactly is happening in my brain when I have a song "stuck in my head?"
gpt
It's called an earworm. Much about them is still unknown, but nearly all of us experience earworms. Repetitive rhythms ("catchy tunes") make a song easier to reproduce in our heads, and unusual time signatures or unresolved or incomplete musical ideas excite an abnormal reaction in the brain; they bother us, perhaps because we strive to communicate completely and clearly. These unusual/abnormal qualities compel the attention of the brain, forcing it to repeat the song in a phonological loop. So, we fixate on these little snippets of songs, replaying them over and over in our heads, hoping to resolve them, which of course doesn't work. Repetition does not remove the song from the phonological loop, but increases the length of its presence. Earworms are quite literally a cognitive itch, an itch that gets worse by being scratched.

There's no completely effective way to get the song out of your head, but most methods center around distracting yourself (sing another song), or taking steps to resolve the musical idea and relieve the cognitive itch (listen to the song all the way through).