Before he succeeded his father as king, the Babylonian Nebuchadnezzar was a successful army commander, amongst other things, in his battle with the Egyptians. After those successes he became king. Babylon became the most powerful empire. In this way, Jehoiakim also became a vassal of Nebuchadnezzar. Daniel 1:1–2 is certainly dealing with the same event as 2 Kings 24:1. After three years, Jehoiakim tries to free himself off the yoke but fails.
1 In his days, Nebuchadnezzar king of Babylon came up, and Jehoiakim became his servant for three years. Then he turned and rebelled against him.