Daniel knew the danger of refusing an order from the king. But Daniel knew he must do what's right, regardless of the social pressures or the political consequences.
One of the challenges followers of God experience is that, although God is sovereign, God sometimes allows things to occur that we do not understand, and life may not go the way we envisioned. But even amid those realities, God is still in control.