I am convinced that even the seemingly background perception of music loads the brain (as is the case with street noise, for example). Moreover, I noticed that being in headphones I lose in productivity. However, for me this is one of the best ways to absorb new music. Therefore, I balance: I turn it on only when I'm involved in the process of work, plus I alternate between listening to new and familiar ones (mostly ambient). things.
There is no definite answer to this question. It depends on what kind of exam, what kind of music and what kind of person.
Each person perceives different music in different ways, so if you need music for concentration, you should try different ones and see the effect on yourself.
I often write lyrics to music. Most often, under the English or instrumental, so that the words do not distract. This works especially well when there are a lot of distractions around. Music plays through the headphones and I stop being distracted by development and can concentrate on the task.