Jews after the Exile held a strict monotheistic worldview (the so-called Second Temple Judaism). As the Shema declares, there is only one God; to claim a multiplicity of gods was of course a grave blasphemy and a repudiation of Judaism. However, that did not prevent some Jews at that time from thinking of an intermediary figure - whether human or angel - who is so exalted enough that he is almost like God Himself. That doesn’t mean that they are polytheists however: despite accomodating beliefs and applying very honorific rhetoric to such principal-agent figures, they still drew a sharp line between that figure and God in the area of cultic practice, reserving worship for the one God. Later rabbis were however concerned about these claims of a second ‘divine’ power in heaven alongside God and so considered this belief as heretical.
It would seem that the basis of this tradition are Old Testament theophanies which has God appearing as a human-like figure or “the angel of Yhwh” speaking for, and being confused with, the Lord. Also, the references in some passages to a ‘lord’ alongside the Lord would have also contributed to the speculation, for example Psalm 110: “Yhwh says to my lord: ‘Sit at my right hand, until I make your enemies your footstool.’” Daniel is the earliest Scriptural witness we have to apocalyptic traditions of a heavenly figure - the “one like a son of man” who is exalted by the “Ancient of Days.”
“As I looked,
thrones were placed,
and the Ancient of Days took his seat;
his clothing was white as snow,
and the hair of his head like pure wool;
his throne was fiery flames;
its wheels were burning fire.
A stream of fire issued
and came out from before him;
a thousand thousands served him,
and ten thousand times ten thousand stood before him;
the court sat in judgment,
and the books were opened.
…] I saw in the night visions,
and behold, with the clouds of heaven
there came one like a son of man,
and he came to the Ancient of Days
and was presented before him.
And to him was given dominion
and glory and a kingdom,
that all peoples, nations, and languages
should serve him;
his dominion is an everlasting dominion,
which shall not pass away,
and his kingdom one
that shall not be destroyed.”
There was also some early Enochic traditions to this effect, although given how late Daniel tends to be dated by many scholars nowadays (2nd century BC), they would argue that these Enoch material are older.