Nehemiah 11:8, “And the Levites: Jeshua, Binnui, Hadmiel, Sherebiah, Judah, and Mattaniah, who with his brothers was in charge of the songs of thanksgiving.” ESV
We mistakenly think songs of thanksgiving are for those times we receive a great blessing. Songs of thanksgiving are to be offered during the hard times for the things we know God is going to do.
The Israelites were back in the promised land, but their homes had been empty, or occupied by others, for 70 years. Many had been burned to the ground.
They were living in a time of famine, see Nehemiah 5:1-5. They were thankful God was taking care of them during their difficulties. They had peace.
“Peace – Shalom…is not the absence of war, but a positive state of rightness and well-being.” NIV Study Bible Notes