Heaven and Hell afterlife
The Babylonian captivity or Babylonian exile is the period in Jewish history during which a large number of Judeans from the ancient Kingdom of Judah were captives in Babylon, the capital city of the Neo-Babylonian Empire, following their defeat in the Jewish–Babylonian War and the destruction of Solomon's Temple in Jerusalem. The event is known to be historical, and is described in the Hebrew Bible in addition to archaeological and extra-biblical sources.
After the Battle of Carchemish in 605 BCE, the Babylonian king Nebuchadnezzar II besieged Jerusalem, which resulted in tribute being paid by the Judean king Jehoiakim.[1] In the fourth year of Nebuchadnezzar II's reign, Jehoiakim refused to pay further tribute, which led to another siege of the city in Nebuchadnezzar II's seventh year (598/597 BCE) that culminated in the death of Jehoiakim and the exile to Babylonia of his successor Jeconiah, his court, and many others; Jeconiah's successor Zedekiah and others were exiled when Nebuchadnezzar II destroyed Jerusalem in his 18th year (587 BCE), and a later deportation occurred in Nebuchadnezzar II's 23rd year (582 BCE). However, the dates, numbers of deportations, and numbers of deportees vary in the several biblical accounts.[2][3]
After the fall of the Neo-Babylonian Empire to the Achaemenid Empire and its founding king Cyrus the Great at the Battle of Opis in 539 BCE, exiled Judeans were permitted by the Persians to return to Judah.[4][5] According to the biblical Book of Ezra, construction of the Second Temple in Jerusalem began c. 537 BCE in the new Persian province of Yehud Medinata. All of these events are considered significant to the developed history and culture of the Jewish people, and ultimately had a far-reaching impact on the development of Judaism.
Archaeological studies have revealed that, although the city of Jerusalem was utterly destroyed, other parts of Judah continued to be inhabited during the period of the exile. Most of the exiled did not return to their homeland, instead travelling westward and northward. Many settled in what is now northern Israel, Lebanon, and Syria. The Iraqi Jewish, Persian Jewish, Georgian Jewish, and Bukharan Jewish communities are believed to derive their ancestry in large part from these exiles; these communities have now largely immigrated to Israel.[6][7]
https://en.wikipedia.org/wiki/Babylonian_captivity
-----------------
Babylonian Captivity, also called Babylonian Exile, the forced detention of Jews in Babylonia following the latter’s conquest of the kingdom of Judah in 598/7 and 587/6 bce. The captivity formally ended in 538 bce, when the Persian conqueror of Babylonia, Cyrus the Great, gave the Jews permission to return to Palestine. Historians agree that several deportations took place (each the result of uprisings in Palestine), that not all Jews were forced to leave their homeland, that returning Jews left Babylonia at various times, and that some Jews chose to remain in Babylonia—thus constituting the first of numerous Jewish communities living permanently in the Diaspora.
Many scholars cite 597 bce as the date of the first deportation, for in that year King Jehoiachin was deposed and apparently sent into exile with his family, his court, and thousands of workers. Others say the first deportation followed the destruction of Jerusalem by Nebuchadrezzar in 586; if so, the Jews were held in Babylonian captivity for 48 years. Among those who accept a tradition (Jeremiah 29:10) that the exile lasted 70 years, some choose the dates 608 to 538, others 586 to about 516 (the year when the rebuilt Temple was dedicated in Jerusalem).
https://www.britannica.com/event/Babylonian-Captivity
-----------
Jewish sources are conflicted about what happens after we die.
By Rabbi Or N. Rose
The subject of death is treated inconsistently in the Bible, though most often it suggests that physical death is the end of life. This is the case with such central figures as Abraham, Moses, and Miriam.
There are, however, several biblical references to a place called Sheol (cf. Numbers 30, 33). It is described as a region “dark and deep,” “the Pit,” and “the Land of Forgetfulness,” where human beings descend after death. The suggestion is that in the netherworld of Sheol, the deceased, although cut off from God and humankind, live on in some shadowy state of existence.
While this vision of Sheol is rather bleak (setting precedents for later Jewish and Christian ideas of an underground hell) there is generally no concept of judgment or reward and punishment attached to it. In fact, the more pessimistic books of the Bible, such as Ecclesiastes and Job, insist that all of the dead go down to Sheol, whether good or evil, rich or poor, slave or free man (Job 3:11-19).
It goes on...
https://www.myjewishlearning.com/article/heaven-and-hell-in-jewish-tradition/
=============
From other reading it seems Jews were polytheistic and no heaven and hell concept.
Then they were in exile in Babylon and exposed to Zoroastrianism.
Zoroastrianism was the world's only (at that time) and oldest monotheistic religion.
It has God (mazda)
and his evil Devil counterpart (Azura mazda) .
Heaven and Hell
etc
So when changing from polytheists to monotheists Jews had a problem explaining evil (which preciously was explained with one of their other Gods - Baal, Moleck) which Jews appeased with child sacrifices etc.
If only one God then where did evil come from?
The devil
-------
https://www.britannica.com/topic/Zoroastrianism