It's a form of mind-wandering; earworms tend to pop up when our brain is idle or seeking distraction—often when we're bored, but sometimes when we're simply overloaded.
Why do we get earworms?
An earworm is music that plays in your head on repeat. ... There are a number of triggers that can lead to earworms, the most common one is to have recently listened to the song. Other triggers include memories or thinking about associated things, or even dreaming; we can wake up with an earworm already in place.
Where do corn ear worms come from?
The corn earworm can be found throughout the United States. It is found in agricultural fields and gardens where corn, tomatoes or cotton are grown. The length of time in which the corn earworm is active depends on the climate and hardiness zone.