I believe “Elohim” means Lord of Hosts, those being the hosts of heavenly beings.
One thing I learned in studying the Old testament is that the Israelites were not always monotheistic (belief in only one god). Rather, they were like other tribes in the area, believing in multiple deities for harvests, rivers, etc… and also that each tribe had its own gods, who fought each other just as the tribes would fight each other. Winning a war would show that your god was stronger, and expanded your god’s geographic domain.
Eventually, the Israelites started saying that their God was god above all other gods, but the other gods still existed. Finally, this morphed into a belief that Yahweh was the only god that actually existed.
Understanding that gods were seen as belonging to different tribes explains why worshiping a different God was taken so seriously - it was essentially treason.
However, despite believing in only one God, the Israelites had a bunch of minor gods that didn’t really fit with monotheism. So these were re-interpreted as servants, or Angels, to the one true God. Basically, ancient Israelite paganism gradually evolved into monotheism.