There is but one God, according to Jewish religious dogma. No other exists. We tend to assume that our forefathers devoutly believed the same. But the truth is that the Bible also shows, time and again, that wasn't the prevailing system of belief among the ancient Israelites.
The different scribes who wrote most of the biblical canon believed the incorporeal world was populated by a multitude of gods, but that the Hebrews should not worship any of these other deities, only Yahweh (which is what scholars call henotheism or monolatry). This is explicitly stated in the Second Commandment: “Thou shalt have no other gods before me” (Exodus 20:3).
The verse "Who is like unto thee, O Lord, among the gods?" (Exodus 15:11) is even more explicit about other gods existing alongside Yahweh.
Among the books of the Bible we find reference to a great many other gods, sometimes with explicit references to miracles performed by them. These gods are generally members of the West Semitic pantheon of gods, those worshipped by people speaking languages closely related to Hebrew.
It came to encompass
Arguably the most important of these gods was Ba’al (“master”), who is mentioned about 90 times in the Bible. Ba’al was an honorific title of the god Hadad, in much the same way that "Adonai" (“my master”) is an honorific title for Yahweh.
Ba’al/Hadad was the West Semitic storm god, responsible for bringing the rains. His cult was thus particularly important in arid regions, where an especially dry winter could result in mass starvation. The historic books of the Bible recount an ongoing competition between the worship of Yahweh and Ba’al, eventually resulting in the supremacy of Yahweh. It seems however that the Israelite devotion to their intangible deity stemmed in part from Yahweh coming to encompass certain characteristics of the pagan god.
One explicit contest is presented in 1 Kings 18. It sounds like nothing so much as a competition like “Israel’s Next Top God,” in which the prophet Elijah and Yahweh compete for the heart of Israel against 450 priests and their god Ba’al.
The people of Israel assemble in Mount Carmel (roughly where Haifa is today) to view the competition, the story relates. Elijah begins the contest, as prophets do, by chiding the people: “How long will you waver between two opinions? If the Lord is God, follow him; but if Baal is God, follow him.”
The issue is to be decided by a miracle. Each side sets up a pyre on which a slaughtered bull is to be sacrificed. The priests of Ba’al are to beseech their god to set their pyre ablaze, while Elijah is to do the same with his Yahweh and his pyre.
Predictably, Ba’al’s pyre does not ignite, while that of Yahweh does, even though Elijah doused it with water just to make it harder. The people of Israel choose Yahweh as their god and kill the 450 priests of Ba’al to a man.
To drive home the point of Yahweh's supremacy, the Bible tells us that after this, a storm arrived and heavy rain fell. It is Yahweh who controls the rains, not Ba’al.
The victory of Yahweh
It seems that what this story and other biblical stories like it are telling is that the belief in Yahweh supplanted the worship of Ba’al. In fact it seems that in some ways, Yahweh subsumed Ba’al, taking on his attributes and powers.
In some of the Bible’s more poetic texts, Yahweh is presented as a storm god in very much the same language that Ba’al is described:
“At the brightness that was before him his thick clouds passed, hail stones and coals of fire. The Lord also thundered in the heavens, and the Highest gave his voice; hail stones and coals of fire. Yea, he sent out his arrows, and scattered them; and he shot out lightnings, and discomfited them” (Psalms 18:12-14).
Of course, Ba’al is not the only god of the West Semitic pantheon to be mentioned in the Bible. Ba’al’s father, Dagon, the god of the harvest, also makes an appearance, again in stories aimed at showing Yahweh’s superiority over him.
In 1 Samuel chapter 5 we are told that after the Philistines captured the Ark of the Covenant, they took it to the Temple of Dagon in Ashdod. But this resulted in the miraculous destruction of his cult statue. Yahweh wins again.
Dagon’s father was El, the head of the West Semitic pantheon. The name Israel, shows that El was originally the tutelary god of Israel (it’s right there in the name!), but over time, Yahweh took El’s place:
“When the Most High (El Elyon) divided to the nations their inheritance, when he separated the sons of Adam, he set the bounds of the people according to the number of the children of Israel. For the Lord's (Yahweh’s) portion is his people; Jacob is the lot of his inheritance” (Deuteronomy 32:8-9).
In this ancient text, we can see that El and Yahweh were still perceived as being two separate deities, with Yahweh subordinate to El. But as time went by, El and Yahweh became conflated: the two deities began to be seen as one and the same.
In Exodus 6:3 God tells Moses: "I appeared unto Abraham, unto Isaac, and unto Jacob, by the name of God Almighty (El Elyon), but by my name Jehovah was I not known to them." Thus the ancients only knew God as El, but as time went by they discovered that El was just another name of Yahweh.
El had a consort, the goddess Asherah, and as Yahweh took El’s place, Asherah became Yahweh’s consort. We are told that the Asherah was worshipped in the earliest Temple of Jerusalem – not explicitly, but we are definitely told that her symbols were removed from the Temple, so they had to be there in the first place (1 Kings 15:13 and 2 Kings 23:14).
It was only at the very end of the First Temple period, during the reign of King Josiah (the second half of the 7th century B.C.E.) that the cult objects of Asherah were taken out of the Temple, quite dramatically. There are quite a number of references to Josiah's monotheistic reforms, such as:.
"Josiah smashed the sacred stones and cut down the Asherah poles and covered the sites with human bones" (2 Kings 23:14, New International Version)
Actually El was the father of many gods besides Dagon, several of whom were explicitly mentioned in the Bible.
Mot, the personification of death, is described in several passages as a deity. In Job 18:13 he is said to have a son, and in Habakkuk 2:5 we are told he opens his mouth wide and swallows souls.
Another of El’s sons was the sea itself, unimaginatively called Yam (the Ugarit and Hebrew word for "sea"), though the Bible calls the god "Rahab". For example Job 26:12 says that God “divideth the sea with his power, and by his understanding he smiteth Rahab.” Legends of a storm god such as Ba’al defeating the sea are very common in the Ancient Near East.
Things you can't look at: Yahweh, and the sun
The sun and the moon, dawn and dusk, as well as other natural phenomena were also deified in ancient West Semitic religions and likely in ancient Israel too, though it is less apparent in the Bible.
It is likely that Beit Shemesh was a center of sun worship since the place name literally means “House of Sun.” Jericho was probably at some point a center for moon worship. The city's name in Hebrew is "Yerikho"; and the Hebrew word for the moon is Yarekh, which other West Semitic languages use as the name of the moon god.
The Bible does refer to the sun and moon of course, often showing that God has total control over them such is when he stops them in the sky (Joshua 10:13), but it doesn’t refer to them explicitly as personified deities.
Yet the ancient Hebrews clearly adored them just like the other West Semites did. Ezekiel (8:16) recounts seeing people worshiping the sun in the Temple. We can infer this because the bible specifically condemns their worship, and we are told that Josiah took actions to stomp out the cult in the late First Temple period, the second half of the 7th century B.C.E. These actions included removing cult objects from the Temple itself (2 Kings 23:11).
The Bible also recounts that the ancient Hebrews worshipped a god named Moloch, who was associated with the Ammonites and with child sacrifice. This worship too was stamped out by Josiah in the same reform (e.g. 2 Kings 23:10).
The historic books of the Bible were written by a “Yahweh only party” and are thus keenly critical of the worship of other gods in Judah. Still, it is clear from their description that polytheism was the norm in the First Temple period. It was only during King Josiah’s reform that the "Yahweh only party" really took control and began pushing other gods out of Judean minds.
But note that they didn't claim other gods did not exist. They only stated that their worship was forbidden by Yahweh, or as Exodus 34:14 has it: "For thou shalt worship no other god: for the Lord, whose name is Jealous, is a jealous God."
It was apparently only during the Babylonian Exile (about 586 B.C.E. to 500 B.C.E) and the following Second Temple period (500 B.C.E. to 70 C.E.), that Judaism progressed from the belief that Yahweh is the only god that should be worshipped, to the belief that he is the only god that exists. I.e., monotheism was born.
This view is stated clearly in the words of Second Isaiah written at the very end of the Exilic period and the very beginning of the Second Temple period: “This is what the Lord says— Israel’s King and Redeemer, the Lord Almighty: I am the first and I am the last; apart from me there is no God” (Isaiah 44:6).