There's a place for both. Sometimes I listen to music and dance around while I crank out tasks that require some thought, but not a ton.
And other times for really menial tasks like cleaning I'll zone out cause my mind can truly wander during those moments (cause putting the dishes away is full autopilot, where things like... writing some tests might be a bit more... autopilot, a bit of thought, autopilot, etc). There is an absolute ton of value in letting your brain wander.
And finally, for certain tasks, it's either very quiet classical or none at all cause it's just fully focused thought about larger problem spaces that need to be fleshed out.
And I think, if you listen to the same library or playlists a lot, your brain may start to associate it with working. But I really have no idea what I'm talking about, so who knows!
The same library or playlist is good - I used that trick for time tracking when I was training for the marathon.
Had a eclectic playlist where I would start with some quite chill Mozart because I would always start too fast and needed to pace myself for example then after the 2/2.5 hr mark is when I'd usually start to fade and some prog rock would come on to boost my spirits.
Funnily I have banned listening to classical for most coding but that's a me problem because I end up listening too closely and analysing the music and performance too much. But that's just because I'm a classical nerd