Many things could be and have been written about this beautiful, meaningful psalm. It is chock-full of spiritual instruction, but we can only touch on a few highlights here.
The psalm begins, "The LORD is my shepherd." David, the author of this song, portrays God as a shepherd guarding His flock. He proudly, almost boastfully, proclaims himself under God's personal care. He says that God is his Protector and Provider, the One he looks to for all his needs. Christ Himself—the greater David—when He was human, said, "I can of Myself do nothing" (John 5:30). Because we are weak, corruptible, mortal human beings, we have to depend entirely upon God for everything.
The song continues, "I shall not want." Want here means "lack." David is confident that he would lack nothing to support his body and life, that God would provide all his needs. Psalm 34:9-10 echoes this sentiment, as does Matthew 6:25-34.
David writes in Psalm 23:2, "He makes me to lie down in green pastures; He leads me beside the still waters." David compares himself to a lamb contentedly grazing, resting, and drinking while the Shepherd watches over him. Such activities have spiritual counterparts in Bible study, meditation, and prayer. The New Testament refers to God's people as lambs or sheep (Luke 10:3; I Peter 2:25). Jesus Himself is called both a Shepherd (John 10:1-30; Hebrews 13:20; etc.) and the Lamb of God (John 1:29, 36; Revelation 5:6, 12: 13:8; etc.).
The psalmist continues, "He restores my soul." David, aware he is a sinner, also knows that God redeemed him and gave him life. David elsewhere expresses his great joy at having his sins forgiven (Psalm 51).
David's next thoughts are, "He leads me in the paths of righteousness for His name's sake." What is righteousness? "All Your commandments are righteousness," answers the same author in Psalm 119:172. When we obey and are blessed, God is glorified. But even the will to obey comes from God; no man can find the path to true righteousness without being led to it by God (see Romans 2:4).
Looking forward, David writes, "Yea, though I walk through the valley of the shadow of death, I will fear no evil; for You are with me; Your rod and Your staff, they comfort me." David has such confidence in God that he shows no fear even in the face of death! This peace of mind comes only from God. Paul tells the young evangelist Timothy, "For God has not given us a spirit of fear; but of power and of love and of a sound mind" (II Timothy 1:7; see I John 4:18).
David goes on in Psalm 23:5, "You prepare a table before me in the presence of my enemies; You anoint my head with oil; my cup runs over." God promises to bless us even though enemies may surround us. Not only will He supply our needs, but He will supply "exceedingly abundantly above all that we ask or think" (Ephesians 3:20). Jesus says God will give to us "pressed down, shaken together, and running over" if we follow His way of give (Luke 6:38).
The psalm concludes, "Surely goodness and mercy shall follow me all the days of my life; and I will dwell in the house of the LORD forever." Because of following God's way of life and living in the care of the Good Shepherd, David looks forward to a full physical life, and after that, abundant, eternal life in God's Kingdom.