Daniel had the proper resolution in Daniel 1:8. 
"But Daniel resolved not to defile himself with the royal food and wine,..." 
He had the proper response in Daniel 2:14.
"When Arioch, the commander of the king's guard, had gone out to put to death the wise men of Babylon, Daniel spoke to him with wisdom and tact." 
Thirdly, Daniel had and knew the proper reward for himself in Daniel 5:17. 
"Then Daniel answered the king, 'You may keep your gifts for yourself and give your rewards to someone else.  Nevertheless, I will read the writing for the king and tell him what it means." 

But Daniel did not get a chance to even react to the charges brought against him in Daniel 6:16.  "So the king gave the order, and they brought Daniel and threw him into the lions' den."  However, it is interesting to note that the king at that time, King Darius, must have liked Daniel because Scripture previous to that says, "When the king heard this, he was greatly distressed; he was determined to rescue Daniel and made every effort until sundown to save him."(Daniel 6:14) 

When I first read this verse, I thought - Really?! The king cannot make a new law that would save his friend?  The king even seemingly knew Daniel's history with run-ins with the law and miraculous rescues because - "The king said to Daniel, 'May your God, whom you serve continually, rescue you!' " (Daniel 6:16)  With this previous knowledge and extended effort to keep Daniel from the sentence to come, by the king himself, this situation was NOT reversible.  Daniel was thrown into a den of lions, "a stone was brought and placed over the mouth of the den, and the king sealed it with his own signet ring and with the rings of his nobles, so that Daniel's situation might not be changed." (Dan. 6:17)  During the night, the king could not sleep, could not eat, and did not have any entertainment that night because of this situation and how he felt about it. 

The culprits that began this whole disturbance were the administrators and satraps of Babylon.  Daniel was up for a promotion of the biggest kind - one that would place him over the entire kingdom (Daniel 6:3).  Guess who did not care for the king's pick?  So, their plan consisted of trying to trap both Daniel and the King.  The only way, they figured, to do that was to mix Daniel's belief with a new law made by the King that clashed with both Daniel's faith and Babylon's political/religious system - then catch him at violating the new law.  Their plan worked, but my message throughout this writing is - for a reason.

God sent an angel and shut the mouths of the lions during the night.  Daniel probably slept just fine with lions being tamed to that of house cats by one of God's heavenly agents.  The next morning the King was elated when he found out Daniel was still alive and had Daniel lifted out of the den.  The only time Daniel speaks is in response to the king's inquiry about his condition in the den before he is hoisted up, "Daniel answered, 'O king, live forever!  My God sent his angel, and he shut the mouths of the lions.  They have not hurt me, because I was found innocent in his sight.  Nor have I ever done any wrong before you, O king."

Notice how Daniel answers the king's question but then adds his own displeasure or by-the-way statement at the end and I don't blame him - "Nor have I ever done any wrong before you, O king."

Add guilt for Daniel's innocence to the already mounting emotions the king might be feeling toward the administrators and satraps and you have one part of God's plan about to see fruition - certain evil governmental officials eliminated.  In fact, they and their families would receive the same sentence that Daniel was given - death by lions.

Another reason this played out was so that a decree in every part of the kingdom of Babylon, for people to fear and reverence the God of Daniel, would be initiated and executed.  Thirdly, the experience was to personally prosper Daniel (Daniel 6:28).

Favor, is the key reason things played out the way they did in Daniel's life.  God's favor toward Daniel was in direct relation to Daniel's proper living and within this life properly reacting in the beginning of his circumstances.  Daniel received favor in the most elevated places of government.  He was the sole interpreter of the king's dreams and visions which saw it's own rewards.  And God saw to it that worship of Himself was allowed by His people while they were in pagan captivity - what an awesome God!

I say this for myself as well as for you the reader - the next time you are going through something you don't think you should be going through (maybe you don't even get a say in the matter, like Daniel), allow it to play out, being faithful to God and His way of living.  It never hurts to pray it out while you play it out either, but the main thrust here is not to force any issue.  Be observant as possible and be carefully selective with your words upfront in the situation.  Then the God of Favor will bless you according to His will for your life.