2 Kings 14-15
(טז) לֹֽא־יוּמְת֤וּ אָבוֹת֙ עַל־בָּנִ֔ים וּבָנִ֖ים לֹא־יוּמְת֣וּ עַל־אָב֑וֹת אִ֥יש בְּחֶטְא֖וֹ יוּמָֽתוּ׃ (ס)
(16) The fathers shall not be put to death for the children, neither shall the children be put to death for the fathers; every man shall be put to death for his own sin.

Rashbam on Deuteronomy 24:16

By the courts. This was spelled out in II Kings (14:6) ”But he did not put to death the children of the assassins, in accordance with what is written in Deuteronomy (24:16).”

While it is forbidden for human authorities to kill children on account of the sins of their father, God reserves the right for Himself to do so, as we know from Exodus (20:4), "He requites the sins of the fathers to the children", if they continue in the evil footsteps of their fathers whose punishment God had suspended while hoping for their children to redeem their fathers by their exemplary conduct.

This principle has been spelled out even more clearly in Ezekiel (18:2) where the prophet had been challenged by the exiles with the question: ‘If the parents ate unripe grapes, why should their children suffer from the resulting diarrhea?’ They meant that seeing they had been exiled, rejected by their master, God, the laws of the Jewish religion should no longer apply to them. The thrust of our verse here is that the court does not have the right to use an innocent child as hostage for the crimes of his father in absentia..

אמר רב יהודה אמר שמואל

כל כסף וזהב שבעולם יוסף לקטו והביאו למצרים שנאמר (בראשית מז, יד) וילקט יוסף את כל הכסף הנמצא

אין לי אלא שבארץ מצרים ושבארץ כנען בשאר ארצות מנין

תלמוד לומר (בראשית מא, נז) וכל הארץ באו מצרימה

וכשעלו ישראל ממצרים העלוהו עמהן שנאמר (שמות יב, לו) וינצלו את מצרים

...

והיה מונח עד רחבעם

בא שישק מלך מצרים ונטלו מרחבעם שנאמר (מלכים א יד, כה) ויהי בשנה החמישית למלך רחבעם עלה שישק מלך מצרים [על ירושלים] ויקח את אוצרות בית ה' ואת אוצרות בית המלך

בא זרח מלך כוש ונטלו משישק

בא אסא ונטלוהו מזרח מלך כוש ושיגרו להדרימון בן טברימון

באו בני עמון ונטלום מהדרימון בן טברימון

בא יהושפט ונטלו מבני עמון והיה מונח עד אחז

בא סנחריב ונטלו מאחז

בא חזקיה ונטלו מסנחריב והיה מונח עד צדקיה

באו כשדיים ונטלוהו מצדקיה

באו פרסיים ונטלוהו מכשדיים

באו יוונים ונטלוהו מפרסיים

באו רומיים ונטלוהו מיד יוונים ועדיין מונח ברומי:

Rabbi Yehudah said in the name of Shmuel:

Joseph gathered all the silver and gold in the world and brought it to Egypt, as it says, (Genesis 47:17) "Joseph gathered in all the money that was to be found in the land of Egypt and in the land of Canaan."

This only shows from the land of Egypt and Canaan. From where do we learn about the rest of the world?

The Torah states, (Genesis 41:57) "And all the land came to Egypt.."

And when they departed Egypt, they brought it up with them, as it states (Exodus 12:36), "And the Lord had disposed the Egyptians favorably toward the people, and they let them have their request; thus they stripped the Egyptians."

...

And there it stayed until Rehoboam.

Shishak, king of Egypt came and took it from Rehoboam, as it says (I Kings 14:25),
"In the fifth year of King Rehoboam, King Shishak of Egypt marched against Jerusalem and carried off the treasures of the House of the Lord and the reasures of the royal palace."

Then Zerach, King of Ethiopia came and took it from Shishak.

Asa came and took it from Zerach, and sent it to Hadrimon son of Taberimon.

The Ammonites took it from Hadrimon son of Taberimon.

Jehosophat came and took it from the Ammonites, and there it stayed until Ahaz.

Sanhereb came and took it from Ahaz.

Hezkiah took it from Sanhereb, and it stayed with him until Tzidkiyah.

The Chaldeans took it from Tzidkiyah.

The Persians took it from the Chaldeans.

The Greeks took it from the Persians.

The Romans came and took it from the Greeks, and it is still in Rome.