Psalm 107 has a clear structure. Verses 1 through 3 form an introduction, and verses 33 through 42 form the first part of a conclusion, and verse 43 is the second part of the conclusion.
The introduction explains that God has “redeemed from trouble” and “gathered” his people, and a third-person jussive tells the reader that the people should thank God for his salvation.
Between the introduction and the conclusion, the body of the Psalm is cyclic and goes through four iterations. Each iteration, and the subparts within the iteration, is clearly marked by identical stock phrases. New cycles begin at 107:4, 107:10, 107:17, and 107:23 with the word “some” in the ESV, but in Hebrew, the initiation of a new cycle is more subtle. Each of the four cycles begins with a plural: three times it is a plural verb and once it is a plural adjective. While understated, it is nonetheless a reliable marker, and this becomes clear after multiple readings.
The first part of each cycle describes a difficult situation in which a group of people finds themselves. The second part of the cycle begins with “Then they cried to the Lord in their trouble, and he delivered them from their distress.” This sentence is identical in each of the four cycles, and leaves no doubt that it is marking the beginning of the second part of the cycle. After this is a narrative of deliverance, narrating how God saved the people from the situation.
The third and final part of each of the four cycles begins with “Let them thank the Lord for his steadfast love, for his wondrous works to the children of man!” After this is another third-person jussive, more particular to the first two parts of the cycle, indicating the specific nature of the rescue for which the people should be thankful.
The first part of the conclusion lists different ways in which God saves; the second part of the conclusion is again a jussive, this time singular, ascribing wisdom to whomever meditates and reflects on God’s salvation.
Psalm 107 displays a deliberate and highly structured organization, almost all of it in couplets, and many of those couplets manifesting the typical parallelism which one associates with Hebrew poetry.