Then shall the trees of the wood sing for joy before Yahweh; For he comes to judge the earth.
So David gave him the lyrics, and these guys started singing and worshipping the Lord with this song or psalm.