Music affects the emotional centers of our brains, sometimes leaving deep grooves we can reference in the future to feel how we felt when we first heard it. Music works like language does to communicate with the listener - basically sound and dynamics - and even synch with others.
From the Greater Good on why we love music:
“If I’m a performer and you’re a listener, and what I’m playing really moves you, I’ve basically synchronized your brain rhythm with mine,” says Large. “That’s how I communicate with you.”
"...when people listen to unfamiliar music, their brains process the sounds through memory circuits, searching for recognizable patterns to help them make predictions about where the song is heading. If music is too foreign-sounding, it will be hard to anticipate the song’s structure, and people won’t like it—meaning, no dopamine hit. But, if the music has some recognizable features—maybe a familiar beat or melodic structure—people will more likely be able to anticipate the song’s emotional peaks and enjoy it more. The dopamine hit comes from having their predictions confirmed—or violated slightly, in intriguing ways."