Under the Mosaic Law, Israel was required to be faithful or they would go back into captivity. After Egypt, the children of Israel
rebelled against God and they wander in the desert forty years (
Numbers 14:34). During the judges, Israel was persecuted by their Canaanite neighbors for their incomplete obedience (
Joshua 23:13). During the kings of Israel and Judah, they returned to idols. In 721 BC, Israel fell to Assyria (
2 Kings 17:6-7) and in 712 BC, Assyria fell to Babylon (Iraq). Despite the prophets' warnings, Judah was repeatedly attacked by Babylon in 605, 597, 586 and 582 BC. Jerusalem and the Jewish temple were destroyed on the
9th of Av, 586 BC. Even with seventy years of captivity, God had a plan for His people Israel through Daniel
(
Jeremiah 25:11-12).
Them that had escaped from the sword he [Nebuchadnezzar] carried away to Babylon; where they were servants to him and his sons until the reign of the kingdom of Persia: To fulfill the word of the Lord by the mouth of Jeremiah, until the land had enjoyed her sabbaths: for as long as she lay desolate she kept sabbath, to fulfill seventy years (
2 Chronicles 36:20-21).
As God used Israel to judge the Canaanites, He used Assyria to judge Israel and Babylon to judge Judah. In 605 BC which was the third year of Jehoiakim, Nebuchadnezzar of Babylon attacked Jerusalem and captured Jehoiakim. He took some of the vessels from the Jewish temple and put them in the temple of the Babylonian god. He deported some of the nobility of Israel that were educated and wise to advise the king and to learn the ways of the Babylonians. Those selected were Daniel (Belteshazzar), Hananiah (Shadrach), Mishael (Meshach) and Azariah (Abednego). They were trained three years before serving as the king's personal advisors and wise men.
… he should bring certain of the children of Israel, and of the king's seed, and of the princes; Children in whom was no blemish, but well favored, and skillful in all wisdom, and cunning in knowledge, and understanding science, and such as had ability in them to stand in the king's palace, and whom they might teach the learning and the tongue of the Chaldeans (
Daniel 1:3, 4).