I think the shift from polytheism to monotheism is embedded into the text of the OT. Historically it most likely followed a stage of henotheism or monolatry (meaning, "there are many gods but only one of them is to be worshipped", cf. Deuteronomy). Pure monotheism (there is only one God) emerged at the time of the exile, with 2nd Isaiah (Is. 40-55), which does not mean that it was universally accepted in Israel nor even in Judah immediately after the exile.
The result is that the older strata or fragments of the most ancient traditions imply polytheism, whereas the final edition of the texts implies monotheism -- and there is some tension between them.
For instance, the original phrasing (as can be reconstructed from a comparison of the Hebrew masoretic text and the Greek Septuagint) of Deuteronomy 32:8f reads:
When the Most High (Elyôn, title of the supreme god El) apportioned the nations,
when he divided humankind,
he fixed the boundaries of the peoples
according to the number of the gods;
Yhwh's own portion was his people,
Jacob his allotted share.
Yhwh is a god among many, he receives Israel/Jacob as his share from the hands of his father El. To each god his people and its territory. This conception is apparent in several places, e.g. Judges 11:24 (territorial negotiation between Jephtah and the Ammonites/Moabites, whose god was Chemosh):
Should you not possess what your god Chemosh gives you to possess? And should we not be the ones to possess everything that Yhwh our god has conquered for our benefit?
This is apparent in many texts, for instance the story of David or Ruth: moving to another country implies "serving" other gods. Only the exile will change this religious perspective.
Of course the old polytheistic viewpoint is obscured by the general setting of the later monotheistic edition (not to mention the capital ascribed to only one of the nonetheless similar gods in the English versions). Still it shows in many many places.