This is one of those fun questions, like “Mummy—how do babies come into the world?”, or “How does Santa deliver our presents when we have no chimney?” The actual history is a lot more prosaic but more interesting than the pat answers, such as that the Hebrew words for water (mayim) and sky (shamayim) are also seemingly plural but are not (actually they are, as they use plural adjectives as well, and if quacks like a duck and waddles like a duck—it’s a duck). Talmudic tradition of centuries of pilpul is capable of much greater feats than that—such as why placing restrictions on women is really a sign of respect, or why there are several different answers to what happens when Two Men Come Down The Same Chimney.
As always, however, Occam’s Razor applies: the simplest answer is often the correct one.
Orthodox Judaism would like us to believe that it sprang, fully-formed and coherent, in a divine revelation to Moses some 3500 years ago, and everything since then has just been our attempts to probe it and understand it. But like everything in human history, it’s the product of messy evolution—and this history is far more interesting, and human, and believable, than even the most learned of Talmudic explanations.
Originally, the Israelites were polytheistic, like everyone else. Like other nations in Canaan and the Fertile Crescent, they believed in a supreme god named El, who begat other gods (Hadad, Yam, Mot, Baal), whom they worshipped at a place called Bethel (Beit-El = “House of God”).
Then someone came up with the rather sophisticated idea that El isn’t just the chief God, but the only one—and the Creator of the world, to boot. They may have got the idea from the Judahites, a tribe in the mountains south of them, who called their God by a different name—one so holy that it cannot be pronounced as spelled, so they called Him Adonai (which, coincidentally, is also plural, as it means “My Lords”). At any rate, the two religions had much in common, and formed a natural, if sometimes contentious, alliance.
For two or three centuries, these two neighbouring nations lived apart as separate entities, until—in the face of threats from the Arameans in the northeast and Grecian sea people called Philistines who settled along the southwestern coast—they decided to unite and appoint themselves a king—a tall young man by name of Saul, and after he died, a very charismatic redheaded warrior called David, whose son, Solomon, reigned after him. After Solomon’s death, however, the union fell apart, and the two nations separated once again—Israel in the north, Judah in the south. This situation carried on for another two hundred years.
Then, around 725 BCE, Israel was conquered by the Assyrians, who laid it waste and exiled much of the population (as was their custom, with conquered peoples, to reduce the chance of insurrection). Thousands of Israelites sought refuge in Judah, and to help with their absorption, the Judahite king Hezekiah ordered the Israelite religious traditions be assimilated into the Judahite one. So a process began, whereby El (or Elohim, as the pantheon of gods used to be known) was equated with Adonai; the Israelite story of Creation (Gen. 1) was accepted alongside the Judahite one (Gen. 2); and Israelite history and mythology such as Jacob and his sons, the story of Exodus, etc. were merged with the Judahite history and mythology of Abraham and Isaac—to make it look as though Israelites and Judahites had been one nation from the outset.
The rest is history, and commentary.
For future information, see From Two Kingdoms to One Nation, by Shamai Gelander
(Originally written in reply to a question at Quora.com).