This secret chord is perhaps a metaphor for the divine inspiration bestowed on David that allowed him to write so many of the Psalms. That is why it was so pleasing to the Lord, because David was writing what God was showing him.