Pretty much. If the crowd is loud and they aren't rooting for you, then you may opt to listen to music to cancel out the noise they're making.
Besides that, some people just like music and it may help them play better as they are more focused and less nervous.
It's personal preference honestly, not everyone weas them.