The title of Psalm 127, “A song of degrees for Solomon” indicates it was written for Solomon, but does not tell us who the author is. The topic of the psalm is family and it states, “children are an heritage of the LORD and the fruit of the womb is his reward” (Psalm 127:3). It is possible that David wrote this psalm for his son Solomon shortly before his death.
The primary message conveyed in Psalm 127 is that there is a purpose for having children, which is to strengthen our walk with the LORD and to make us less vulnerable to attacks from our enemy, the devil. If you think of your walk with the LORD, or the development of your relationship with him, as being similar to building a city, then having children is like putting up a wall and fortifying the gates so that you cannot easily be attacked.
The basis of David’s relationship with the LOR was the establishment of God’s kingdom on earth. There were many things that David did to make God’s kingdom a reality, but toward the end of his life, David realized there was much left to done. If David did not have a son to carry on the work he had started, then he might have given up and felt that his effort was useless.
David’s son Solomon was actually in a much better position to do some of the things David wanted to, like build the temple of God, therefore, David was assured that progress would continue even after he died. In spite of his sin with Bath-sheba, Solomon was born to David through their marriage. Solomon was a testimony to God’s forgiveness and a sign that David’s relationship with the LORD had been fully restored.
In Psalm 127, children are compared to arrows in the hand of a mighty man and it says that the man that has his quiver full of them will not be ashamed (Psalm 127:4-5). The word translated ashamed “has overtones of being or feeling worthless” (954). When Absalom took over David’s kingdom, David may have wondered what would become of Israel after he was gone. The fighting among his sons was a problem for maintaining peace inside and outside the nation.
It says in 1 Chronicles 29:24-25, “And all the princes, and the mighty men, and all thee sons likewise of king David, submitted themselves unto Solomon the king. And the LORD magnified Solomon exceedingly in the sight of all Israel, and bestowed upon him such royal majesty as has not been on any king before him in Israel.” Solomon was David’s heritage of the LORD and by measure of his stature, he was a great reward to his father.