In revealing His Word to His people Israel, the one true God spoke through each writer in a language that the people could readily understand. Since ancient Israel was an agrarian society, this means that the Lord often revealed truths about Himself using metaphors drawn from agriculture and animal husbandry. One of the most pervasive of these images is that of God as a shepherd, which is the chief metaphor in Psalm 23, undoubtedly the best known of all the biblical psalms.
The pagan nations surrounding Israel often depicted their gods and kings as shepherds, so the Israelites would not have found it strange that God would call Himself a shepherd. Yet it must be noted that Scripture takes the metaphor of a shepherding deity and king and transforms it. Other ancient Near Eastern societies often saw their kings as gods — both king and god were shepherds, yet both god and king were divine beings. In Israel, however, the king was not divine, even though he was a shepherd (1 Chron. 11:1–3). David, the king of Israel, refers to Yahweh, the covenant Lord of Israel, as his shepherd in Psalm 23:1. This both distinguishes the shepherding God from the shepherding king and reveals that the true power behind the human shepherd is the divine Shepherd who rules over creation.
Ancient Israelites would have drawn great comfort from this psalm. Even to this day, there are many dangerous mountain paths in the Holy Land that must be traversed with care, lest people or animals fall to their deaths. Such paths had to be followed to take sheep from arid lands to new watering holes. Thus, when the Lord leads His people through the valley of the shadow of the death, He guides them to places of abundant provision, protecting them from falling under the control of the Evil One, who wields death as a weapon. Just as a shepherd uses a rod — a mace-like instrument to beat off wolves and other predators — and a staff — a long stick used to prod the sheep along and keep them in line — so God protects us from those who would devour us, making sure His people do not stray finally off the right path (v. 4).
Notably, Psalm 23 promises divine protection, not an easy life. God gives us a table in the midst of our enemies; He does not eradicate our foes all at once (v. 5). But He does work to give us rest and refreshment, even when these enemies are at the door.