The psalms are not randomly thrown together, and the way they’re organized is significant. They’re grouped into five “books,” mimicking the five books of Moses’ law. The first four books end with a verse of praise that belong to the book, not the psalm they’re attached to. The editors of the Psalms may have wanted the book’s structure to imply that, even though the psalms are mainly prayers written by believers, they bear the same authority as the Torah since it was God who gave the prayers to their writers.
The ordering of the five books and of the psalms within each book tells us something about their meaning. The first book includes Psalms 1 through 41. This collection includes many psalms written by David, many of them laments. There are small connections between successive psalms, giving each of the books a discernible forward movement–with a predominance of laments, giving way to full-on praise in the fifth book. This suggests that while we endure hardships and pain in this life, we’re moving relentlessly toward a kingdom when all will be joy and praise.