We know that music helps a lot of us through a workout, but the the psychology behind when music works and when it doesn't is still being investigated. The BBC Future has a few ideas about what's going on in your brain.
In general, music has the greatest effect on self-paced exercise:
The benefits of music are largest for self-paced exercise — in other words those sports where some of the work involved is in deciding when to act, as well as how to act. This means all paced exercises, like rowing or running, rather than un-paced exercises like judo or football. My speculation is that music helps us perform by taking over a vital piece of the task of moving, the rhythm travels in through our ears and down our auditory pathways to the supplementary motor area. There it joins forces with brain activity that is signalling when to move, helping us to keep pace by providing an external timing signal. Or to use a sporting metaphor, it not only helps us out of the starting blocks but it helps to keep us going until we reach the line.
It makes sense. After all, music distracts us from fatigue, and at the right BPM music can improve a workout. If you need some help picking out the best exercise headphones, we've got you covered as well.
The psychology of workout music [BBC Future