Beelzebub originated as a Philistine god. In the Bible’s 2 Kings, King Ahaziah of Israel sends messengers to inquire of Ba‘al Zebûb, the god of the Philistine city of Ekron, to learn if he will recover from injuries sustained in a serious fall (and gets into a great deal of trouble from the prophet Elijah for his idolatrous ways).
The Ba'al religion worshipped multiple deities, which were prefixed by the word Ba'al, which means "Lord" in Ugaritic. Baalzebub translates as "Baal (or Lord) of flies." It is possible that this was a derogatory name used by the Hebrews to deride the Ba’al religion.
The gospel of Mark refers to Beelzeboul, prince of demons, who is interchangeable with Satan. The 17th century exorcist Sebastien Michaelis, in his Admirable History (1612), placed Beelzebub among the three most prominent fallen angels, beside Lucifer and Leviathan. Other texts identify Astaroth as the third angel, rather than Leviathan. In Paradise Lost, 1667, John Milton wrote of Beelzebub, "than whom, Satan except, none higher sat."