Playing over and over in our imagination there is nothing we can do. From Pepsi ads to cheesy boy band music, once it gets the ear, it never leaves. Psychology major, Courtney Magill talked about songs getting stuck in people heads in high school. Songs get stuck in Magill's head all the time. Stephen Taylor, assistant professor of music composition and theory believes that humans are all born with a melodic gift.
Melodies stick in our heads the same way faces do.
Usually, though, an entire song doesn't get stuck its just a small portion of the song. This is called a 'hook'. There is a certain kind of genius who can write hooks. So it loops the hook over and over. The hook is a part of a song, usually the first or last line of a chorus.