Daniel, Shadrach, Meshach and Abednego were taken to Babylon in 605 BC. They were trained to serve in the Babylonian government. They were to learn and follow Babylonian ways.
This included speaking, reading, writing, eating, thinking and making decisions like Babylonians did. Daniel and his friends accepted that this was their work. They didn’t fight against it.
God gave them knowledge, understanding and wisdom. As a result of God’s blessing they were successful in their work.
The four friends faithfully followed God’s ways for living. God had explained how he wanted the family line of Jacob to live. He had explained it to them in the Mount Sinai covenant.
God’s people were to be faithful to this covenant. That is how they would live as a kingdom of priests and a holy nation.
There were many parts of the Mount Sinai covenant that couldn’t be followed in Babylon. That included many of the laws about sacrifices. But the laws about clean and unclean foods could be followed.
The court official allowed Daniel and his friends to follow those laws. That is one way that Daniel and his friends showed that they were God’s people. They were still God’s people even though they lived far from the southern kingdom.