The Abrahamic religions have evolved from Canaanite polytheism. The god of the Bible and the Qur’an is an amalgamation of the Canaanite sky god El (the head god of the Canaanite pantheon called the Elohim, meaning “children of El”), and some of El’s sons, including the storm god Ba’al, the sea god Yamm and the Israelite war god Yahweh. Yahweh started out as one of El’s sons.
The Abrahamic religions have also borrowed the concepts of heaven and hell from Zoroastrianism, an older monotheistic religion than Judaism. Zoroastrianism has in its turn evolved from Indo-Iranian polytheism.
The conception of the God of Israel presented in the Hebrew Bible seems to have developed out of two older polytheistic deities, El and Yahweh, who were worshipped in the Levant in the 2nd millennium BC.
The developed monotheism of later Judaism seems to have grown out of an earlier system of “monolatry“, in which the God of Israel was worshipped exclusively but the existence of other deities, was not denied. This monolatry, in turn, developed out of the original polytheism of the peoples of the Levant.
The decisive developments in the advent of monotheism appear to have been the rise of the Deuteronomic movement (7th and 6th centuries BC) and the Babylonian Exile (c.587-538 BC). Polytheistic ideas still remained current to some extent thereafter, however.
I have described in more detail how Judaism has evolved from polytheism through henotheism/monolatry into monotheism
In the Eden segment of Genesis are intriguing references to apparently plural gods. The account of the exodus includes the story of the great numbers of Israelites who had taken to making sacrifices to Baal and worshipping his idol and, disturbingly, was slain at God’s command. The first commandment is, “You shall have no other gods before me.” The second is, “You shall not make idols.” Some experts have argued that this suggests there were other gods and God demanded to be the supreme god, from which he progressed to the Israelites’ only God.
About 4,000 years ago, there was a spate of monotheism in the lands east of the Mediterranean. The Code of Hammurabi is a Babylonian law code of ancient Mesopotamia that was written in stone nearly 3,800 years ago. On the tablet, King Hammurabi says that the one God told him to give the laws to the people. So the concept of the one God was already well rooted. The most famous law from the code is “an eye for an eye, a tooth for a tooth.” This is one of the most misquoted lines in history. It is not a grim call for conspicuous vengeance. Rather, it is one of the great advances in humanistic thought: Take no more than was taken from you.
A bit further east, Zoroastrianism formed out of polytheistic religions in an area now in Iran and India around 2000 B.C., with estimated dates varying considerably. The prophet Zarathustra became its most important leader, though the religion had been information for centuries. Zoroastrian dualism, heaven and hell, sacred time, and angelic beings have influenced Judaism, Christianity, and the Persian religion of Hammurabi. There are still some Zoroastrians, with greatly varying estimates of the number, almost all in Iran and India. There are a variety of local differences in the practice of the faith.
In the 600s A.D., the prophet Mohammed led the forging of monotheistic Islam out of Arab polytheism, and he accomplished it very quickly by the sword. There are exciting accounts of this. Even if you disagree with the methods, it is fascinating for those interested in the development of religious thought.
And there is another interesting case. As Christianity spread, the Catholic Church moved into areas and made its accommodations to political leaders. Then it strategically made pagan gods and mythical figures into Saints of God and pagan festivals into Christian festivals.