Music has substantial evolutionary survival value. There’s a theory, which I find totally convincing, that music is the evolutionary precursor to language, the bridge between the cries and gestures of other primates and our own more abstract communication. Read about it here:
Humans’ success as a species is due entirely to our social organization, and music is a crucial tool for group building and bonding, more than we give it credit for in the western world. We think of music as a form of entertainment, mostly divorced from its most basic purposes. But taking the macro-scale historical view, music isn’t recordings of specialists making pleasant background noise. It’s all the emotional-laden patterned vocalization, percussion and gestures we perform, consciously and not. For example, all parents use music to comfort babies. Sometimes it’s in the form of overt singing and dancing with them, but even routine speaking to very young children is mostly musical in content. There’s the singsong cadence, the repetition, and the warmly modulated tone. This “motherese” is universal among human cultures and is probably very ancient.