The experience of a tune repeating in your head without any intention on your part is common enough to have a research literature and a technical name, involuntary musical imagery, though most people call them earworms. Christmas songs are among the most reliable offenders, and the reasons for that are partly about the music and partly about how much of it you are exposed to.
What makes a tune sticky?
Research on the subject broadly points at the same features: a simple, repetitive melody, a moderately fast tempo, a shape that rises and falls in a predictable way, and then one or two unexpected intervals or rhythmic quirks that stand out against that predictability. Familiar enough to follow, distinctive enough to snag. A great many Christmas songs are built exactly that way.
Why are Christmas songs the worst offenders?
Exposure, mainly. Very few songs in any genre get played in shops, on radio and in public spaces continuously for six weeks. Repeated hearing is the strongest single predictor of a tune lodging, and a December high street delivers more repetitions of a small number of songs than most people encounter in a year. The catalogue is also small, so the same handful come round constantly.
Does it matter that they are seasonal?
It seems to help. A song heard heavily for six weeks and then not at all for eleven months does not become worn out in the way a year round hit does, so each December it arrives with much of its novelty intact. The strong association with a time of year also means that other cues, from a smell to a decoration, can trigger it without the music being played at all.
Repeated exposure is the strongest predictor of a tune sticking. Six weeks of shop radio is doing most of the work.
What actually shifts one?
Listening to the whole song through is the most commonly reported remedy, on the theory that an unfinished tune is what loops. Engaging in a moderately demanding task, such as a puzzle or a conversation, tends to displace it, while a task that is too easy or too hard does not. One study has suggested chewing gum interferes with the process, which is a small but genuine finding.
Does trying to suppress it work?
Generally not, and it can make things worse, in the same way that trying not to think about something reliably fails. Accepting it and doing something else is more effective than fighting it. Most earworms pass within a day or so without any intervention, and the ones that persist are usually being refreshed by hearing the song again.
Is it a problem?
Almost never. For most people it is a mild and frequently pleasant experience, and the research suggests the majority of episodes are of songs people actually like. It becomes a genuine irritation only when it is persistent and unwanted, which is a small minority of cases, and it is worth mentioning to a doctor only if it is causing real distress or interfering with sleep.
Can you avoid it in December?
Not really, short of avoiding shops, which is impractical. What you can control is what plays at home, and building a playlist from the wider catalogue rather than the same eight songs at least means the tune that lodges is one you chose. Several people find that listening to something deliberately unfamiliar on the way home resets it.
What is worth knowing about the research?
That it is a real and reasonably well studied phenomenon rather than a curiosity, with surveys suggesting the large majority of people experience it regularly and that most episodes involve music the person likes.
The findings on what shifts an earworm are less settled than the findings on what causes one, so the remedies above are worth trying rather than relying on. For most people the episode passes on its own within a day.