I think the most common biblical metaphor for life is the story of the exodus. The stages of the exodus are bondage, then deliverance, followed by growth through the wilderness wandering, concluding with their entry into the land of promise. We see this metaphor expressed again and again in the New Testament. David does something a little different in his shepherd–sheep metaphor. Stepping back a bit from the Psalm, you will notice how David describes his journey with the Shepherd.
In the beginning of the Psalm, the Shepherd is before him, leading, guiding, and providing. But when he enters the valley of the shadow of shadows, the Shepherd is beside him, making his presence and protection more readily known. The next scene is a celebration of blessings, marked by a sumptuous banquet and an overflowing cup. But the Psalm concludes with goodness and faithful love behind him pursuing him to his eternal home.
Such is life. God satisfies our souls, providing for our needs. Even though God is faithful in his provision, by no means are we exempt from the challenges we find in the valleys. But it takes two mountains to make a valley. We have been blessed with many benefits that we can celebrate even on the heels of trial and tribulation. But life does not end with death. There’s more in store in eternity. His goodness and unfailing love pursue us like sheep dogs nipping at our heels all the way home.