Shepard's Prayer has been used in so many books.
PSALM 23 The Divine Shepherd
Attributed to: King David
There were several differing accounts of the history behind Psalm 23 or the Shepherd's Prayer. One that is widely accepted is that the psalm was written by King David when he was growing up as a shepherd boy.
Some say that he might have written it when he was escaping the murderous plans of King Saul against him.
Others point to the time when King David was already King of Israel in a war against his own son, Absalom who launched a rebellion against him.
Spiritual Value of Psalm 23
Whatever the history is of Psalm 23, what should be given more emphasis than debating when the said psalm was written, is its spiritual value to the Israelites that time and to us, presently.