Music is about the gaps and interplay between gaps. Music is a form of time keeping, so perhaps time keeping — or time changing. Think of circular time: cycles. Now put yourself around a campfire 10,000 years ago, chanting a rhtymic chant and beating on logs (speculation here). You get lost in the moment – a timeless “space” where you are creating your own spacetime that exists solely within the experience of the music itself.
So, definitely related to time and our mastery of it.
I don’t put too much stock in ‘evolutionary explanations’ for functions beyond some basics, as it becomes purely speculative fairy-tale telling. But still, I tried my hand as a possible “evolutionary function” of music:’