The book of Psalms is a collection of song lyrics. Like many songs, they were first written in response to events in the lives of their authors. Later, the whole community used them in worship. When Israel returned from exile in Babylon many of the songs from over the centuries were collected in the book of Psalms.