Today's New York Times sheds some light on how it works:
“The brain has a strong propensity to organize information and perception in patterns, and music plays into that inclination,” said Michael Thaut, a professor of music and neuroscience at Colorado State University. “From an acoustical perspective, music is an overstructured language, which the brain invented and which the brain loves to hear.”What's this mean for language learners? It means that songs can be a useful device for memorizing, especially the vocabulary contained in a song's lyrics. So look up all the vocab in your favorite target language song and then put that track on repeat. If you get the song in your head, you'll get the vocab in your head as well.
A simple melody with a simple rhythm and repetition can be a tremendous mnemonic device. “It would be a virtually impossible task for young children to memorize a sequence of 26 separate letters if you just gave it to them as a string of information,” Dr. Thaut said. But when the alphabet is set to the tune of the ABC song with its four melodic phrases, preschoolers can learn it with ease.