The brain is constantly building models of the immediate future. Every moment it is generating a prediction and then updating based on what actually happens. Music hijacks exactly this machinery. Rhythm, harmony, and melody are all systems for setting up expectations and then either satisfying or violating them -- and the emotional content of music lives largely in that dance between expectation and resolution.
This is why random noise is unpleasant (you cannot build a predictive model of it -- pure error with no signal) and why perfectly gridified, pitch-corrected pop can feel empty (once you have loaded the model, there is nothing left to predict -- the satisfaction disappears when the surprise does).
It also explains why we can listen to the same song hundreds of times. The model is already perfect -- but the pleasure now comes from running the prediction successfully over and over again, like a comfortable proof you already know the answer to.