It can help by putting you in a good mood, drowning out other noise, and I find the beat can help move faster in speed games.
If the music is too much fun / distracting, then it can make me play worse, so I generally like songs with no instruments or lyrics (so, for example, EDM). It has a good beat and becomes white noise.
Streamers may also do it because it's more entertaining than silence.
Hi, I always see chess streamers playing music in the background while playing chess. And this made me wonder, "Does it make them play/focus better?" I tried it once but I ended up playing the same. Same mistakes, good moves, blunders, literally everything. So why do chess streamers play music in the background?