According to the scriptures, there are special occasions set for Thanksgiving. Just like the word teaches us about praying all the time; living a life of prayer.. yet the bible tells you that there was an hour of prayer (a set time of prayer).
Again he tells us how to fellowship with God. We can pray on our own or have fellowship with others… Yet he told them when to meet; on the first day of the week, which was called THE LORDS DAY.
So, even though we give thanks all the time, he expects us to set a time as he showed us in scripture.
In Nehemiah, you will see how they gave thanks. It was a service of Thanksgiving.
David also did it because the spirit instructed it, not because it was in the law.
Like when he set up a choir, he didn’t do it because it was the law of Moses but because the spirit instructed it.