This Psalm serves as a reminder to any faced with dark circumstances that David found God's glory in a cave! He was being hunted like a dog, but he take a praise break in a cave.
God's glory is greater than our circumstances. His mercy and truth with prevail. And if David can praise him and find his glory while hiding for his life in a cave, then certainly I can find His glory in the middle of my mess!