When I first read Tolkien’s The Lord of the Rings, I was struck by the power putting the songs in there had. I think this is similar. The songs simultaneously establish the setting and comment on the themes of the book and, as number 4 points out, the tone.
The songs mimic the tone of the novel, and they also serve as an entry, if you will, into Kino's mind. He himself does not speak much, but the songs serve as a portal to what he is thinking and feeling at the time. Much the way a music score accentuates the action in a movie, Kino's song accentuate whatever is happening to him at the moment. I love having my students write their own songs of their lives as an activity to go with this novel.
I learnt long time ago, that Negro Spirituals served to comfort black slaves as they worked and to assure them of a promised freedom that one day would come.
I believe that the Songs in "The Pearl" serve to operate on a similar level. The mexican-indian people used songs to express their emotions. These songs became part of their existence for so long and this seemed to be Steinbeck's way of showing this aspect of mexican indian culture to us. Hence, when Kino dives in search of a pearl, he hears the song of the undersea and this is mirroring the anticipation he feels as he searches with deliberate care. In that song, the music of another song emerges. That is the music of the pearl that might be. After finding the pearl, Kino and Juana sit in their brush house, surrounded by neighbours who they think share their joy. Again we are told that they hear the music of the pearl and that the music of the family merges with it and beautify each other.
The songs /music even alert kino to impending evil. As kino sleeps that night, he is troubled and the music of evil plays in his dream. This is what causes him to wake up and it is then that he discovers that someone is in his hut. This intruder wants to steal the pearl. In a later instance, when Kino looked into the pearl to find the images of the positive dreams he has of his future, he only sees his misfortunes and the music of the pearl is then blended with the music of evil.