The Psalms are not a random collection. They were put together, in the order they're in, on purpose. The Psalms reached their final form sometime after the exile to Babylon, which we know because of the several Psalms directly addressing the exile or its aftermath (eg. Psalm 137). The final editors of the Psalms arranged