Where It All Goes Down
The setting of Psalm 23 is, for the most part, pretty generic, and we don't mean that in a bad way. It follows the patterns of a certain genre: the pastoral poem. The classic pastoral poem is about the good life of being a shepherd in the hills, far from the worries of urban life. They're filled with images of calm, domesticated nature. Where a later Romantic nature poem might have images of violent storms, tossing waves, and wild winds, pastoral poems are calmer; the "green pastures" and "still waters" of line 2 are quite typical. The difference between Psalm 23 and other pastoral poems you might have read is that it was written thousands of years ago, when pretty much everyone led a pastoral life.
The poem's setting takes place in two different imaginative spaces: the outside world and the inner soul. Everything that's described in the real world is really a means of symbolically representing what the speaker feels in his soul. This is why the setting doesn't seem particularly realistic, and in some places it leaps directly into the land of symbolism, with images like, "paths of righteousness" and "the valley of the shadow of death." This last image is surely the most famous and memorable in the poem. It's as if death were an ominous mountain like Mt. Doom, casting its dark shadow on the speaker below.
In the last two lines, the setting shifts completely. Say good-bye to pastoral images and say hello to social ones. The poem provides fleeting glimpses of a rollicking banquet, with the Lord playing host. Any aspiring fiction writers out there should take note of how the poet creates an entire atmosphere of luxury and abundance using a single image: "my cup runneth over." Throughout the psalm, small details like this are stitched together to create a mood of safety, ease, and confidence in the continued blessings of the Lord.