The psalmist writes in Psalm 35:18,
I will thank you in the great congregation; in the mighty throng I will praise you.
This is in the context of the psalmist's asking God to deliver him from his enemies. What he promises to God is that if He would do that, he would thank God and praise Him in front of the worshiping congregation. What the psalmist is basically asking is, "Do this for your glory! I will proclaim your glory if you do this."
It may seem to you to be a little manipulative, what the psalmist is saying here. It almost sounds like he's trying to bribe God. But that's not the case. The reality is that the psalmist is appealing to what he knows about God. God does do things to the praise of His glory, not because He's needy of glory, but rather because He is the most glorious being in the universe. He is perfectly glorious, so everything He does is perfectly glorious. That includes being praised by His people.
God's glory is also inseparable from our good. When we behold God's glory, we are delighted because God's glory is beautiful. Since God does what's best for His people, He displays His glory for us to see.
So, the Psalmist is saying, "Do this, so I can praise and thank you for it publicly."
The purpose of public praise and thanks is the glory of God and the subsequent delight of His people. When we hear people give testimony about God's glory and grace, our hearts are filled with joy, and we rejoice together, to the praise of His glory.
Today's reading: Psalms 33-35