Like all successful people, Daniel also was the object of envy of his colleagues. They planned a scheme to trap him and destroy him. The book of Daniel chapter 6 tells us that they made the king order that those who pray to anyone other than the king will be destroyed. Daniel’s enemies knew that being a devout Jew, he will not comply and that will lead to his death.
However, Daniel proved his integrity and followed his routine of prayer. Ignoring the king's order he prayed regularly opening his window towards Jerusalem as he is used to. His enemies caught him in action. They reported the matter duly to the king.
Though the king was reluctant to act against Daniel, they forced the king to act on his own order. The king ordered that Daniel be thrown into the den of hungry lions. We know the story well. The lions did not attack Daniel. God had shut their mouths.
The king spent the night sleepless. At the wee hours of the morning, he rushed to the den of the lions to find out what has happened to Daniel. He finds that Daniel is safe and the lions haven’t even scratched him. At the king’s orders they soldiers pulled Daniel out and his opponents and their entire families were thrown into the same den. The hungry lions tore them apart.
What is important in this story is the song that king Darius sang when Daniel was pulled out of the den of lions (Daniel 6:26-28). The king reverses the earlier order that the people should fear and tremble before the God of Daniel instead of the king.
The story ends not with the rescue of Daniel from the pit, but king Darius proclaiming the glory of Daniel’s God and ordering his nation to fear that God. The book of Daniel tells us that the king sang a song of praise to the God of Daniel.
Things would have been very different if Daniel had given in to the order of the king in order to save his skin. His integrity not only saved his life but led to the greater glory of God before a pagan king and his empire. His prayer to God was private. But he did it ignoring the dire consequence of his action of defying a power lesser than the power of his God. God protected him from the consequence that his opponents had designed for him. He also used that to bring glory to his name in all the empire of Persia.