The people known as the Israelites weren’t special or exceptional; they were just another group of semi-nomadic Iron Age Canaanites (for more on this refer to the series of “Passover” posts from April 2011, or to the works of William Dever on my Further Reading page as linked above). They were arranged in a loose confederation of tribes and often had wars and alliances with other Canaanite groups.
They reached a point at around the eleventh century at which the tribal leadership was no longer effective, so they agreed to put themselves under the rule of a king chosen by the tribal leaders. The first king was Saul, and then came David, who usurped Saul’s line. After the death of David’s son Solomon, the northern tribes rebelled against the Davidic line, leading to the formation of two polities: The Kingdom of Israel and the Kingdom of Judah.
So there’s a historical backdrop for you.
As Canaanites, the Israelites were polytheists. They primarily worshiped Ba’al, Astarte, El, Yahweh, and Asherah. There were more, but those are the most important ones. If you pick up the Bible and look at the books of Judges-II Kings, you’ll see that the author of these books worked very hard to convey the idea of Israelite society as a strictly polytheistic one. However, what can actually be seen in those books is a picture of a society with two distinct forms of worship: there was the Israelite folk religion—in which Ba’al and Asherah etc were worshiped alongside Yahweh—and then there was the religion of the Jerusalem elites who worshiped only Yahweh. In some cases isn’t wasn’t just folk religion: as you’ve seen in the post linked above, worship of Asherah was so widespread that her symbology was present in the Temple.
All of this changed around the eighth century BCE after the 722 fall of the Northern Kingdom to the Assyrian Empire. There came into power within the priesthood a group referred to by scholars as the Yahweh Alone Party. This group was comprised of religious radicals who wanted to institute two things throughout Israelite society 1) worship of Yahweh as the sole deity, and 2) the idea that Yahweh could only be worshiped in Temple in Jerusalem; the writer of Deuteronomy-most of II Kings was a member of this group.
This group instituted a series of reforms which included the destruction of unsanctioned places of worship, the removal of Asherah’s presence from the Temple, the destruction of Asherah poles and alters to Ba’al, and the fusion of El and Yahweh into a singular deity.
However, these reforms were hardly effective. The people continued to worship as they pleased (albeit in a quiet manner) while the King of Judah and the Jerusalem priesthood went about their business, worshiping only Yahweh and pretending that the people did as well.
As you can see, that still wasn’t close to monotheism as we currently understand the term. The event which dramatically changed Israelite/Judahite religion from a form of varied polytheism into strict monotheism came in 586 BCE: the Babylonian Exile. In this year, the Babylonian Empire conquered Judah, destroyed the Temple, and shipped off the majority of the population to Babylon. There, the Judahites were a minority. As a minority they were faced with a question: do they assimilate and cease to be Judahites, or do they forge an enduring identity to ensure the continuation of their existence in exile?
They chose the latter. A big part of the formation of this identity was final abandonment of the worship of the old gods, and the full acceptance of monotheism with Yahweh at the center of their worship. Another aspect of this identity formulation included the determination of how Yahweh could be worshiped without the Temple; the solution to this was the writing of the Bablyonian Talmud.
When Persia conquered Babylon less than 100 years after Babylon’s conquest of Judah, the Persian emperor allowed the “Yehudites” to return under limited self-rule to the Province of Yehuda. Some returned and some stayed; what these two communities now had in common was that they worshiped Yahweh. As history went on and Exile turned to Diaspora, this monotheism and the forms of worship contained in the Babylonian and Jerusalem Talmuds became the factor which continued to distinguish Jews, far flung as they came to be.
So there’s your answer: the Babylonian Exile created a situation in which proto-Jews realized that they had to unify lest they be destroyed. They chose to unify, and with this unification came the full acceptance of monotheism. This monotheism was still a very ancient form of what we now call “Judaism,” but that’s how Jewish monotheism came to be. At least, that’s the short version of how that form of monotheism came to be.