The typical party line about religion is that religion began as animism, the worship of spirits and perhaps ancestors, and was polytheistic (many gods) or pantheistic (everything is God). Eventually mankind became enlightened and some people began to realize there is only one God.
Some would argue that now mankind is becoming even more enlightened by recognizing that belief in any god is a myth, while others are returning to pagan beliefs and embracing the idea of many gods. Still others prefer to view God as a force, or the sum-total of all creation.
The biblical perspective is that mankind originally understood that there was one God. From early on, men began to call upon the name of Yahweh, as noted in Genesis 4:26 (Exodus 6:3 is best understood as a rhetorical question, “and by my Name ‘Yahweh’ did they not know me?”).
Fast forward to the Flood. All mankind, except for Noah’s family, had been annihilated. In Genesis 9:1-17, God makes a covenant (of which the rainbow is a sign) that He will not destroy the entire world with a flood again. He institutes government and capital punishment. Noah worships the one God without an image and recognizes Him as ruler of heaven and earth.
This original monotheistic belief is the original faith of the Flood survivors. Their descendants, however, resented God’s constraints. Instead of spreading out and filling the earth, they huddled together and created a plan to defy the God of Heaven who could destroy with a flood. They began construction on the Tower of Babel (Genesis 11). The tower was to reach to the sky and was sealed with pitch (tar). In my opinion, the purpose of the tower was a watertight container to which the people could flee in the event that God sent another flood.