Psalm 107 repeats the same phrase four times: “then they cried out to Yahweh in their trouble, He saved them from their distress” (vv. 6, 13, 19, 28).
There are four forms of distress: Some wander in a wilderness, hungry and thirsty, unable to find their way to a city (vv. 4-5); some are in a deathly, shadowy prison (vv. 10-11); some suffer distress because of their own rebellion and iniquity, which leads them near the gates of death (vv. 17-18); some are frightened by a storm at sea (vv. 23-27).
Distress comes in the wilderness, in prison, in the grave, at sea. Distress arises at every corner of this four-cornered world. But in each case, the Psalm promises the same result: “He saved them from their distress.” He turns the wilderness into a spring (vv. 33-35), gives a city and an abundant harvest (vv. 36-38), chases oppressors into the wilderness (v. 40). He saves them from their distress.