Beelzebub — also Baal-zebub, 'lord of the flies' — was originally the name of the local Philistine deity of Ekron. King Ahaziah of Israel sends to inquire of this god in 2 Kings 1, and the prophet Elijah confronts him: is there no God in Israel that you must seek out Ekron's idol? The pagan god of one city becomes, in the longer biblical narrative, a name for the false gods of the nations more broadly.
By the time of the Gospels, the name has come to stand for the prince of demons. The scribes from Jerusalem accuse Christ of casting out demons 'by Beelzebub the prince of the devils' (Mark 3:22). Christ refutes them with the famous logic of the divided kingdom — 'If Satan cast out Satan, he is divided against himself; how shall then his kingdom stand?' (Matthew 12:26) — and turns the accusation. The accusation against Christ is itself the unforgivable sin, attributing the work of the Holy Spirit to the demonic.
Whether Beelzebub is a distinct fallen being or simply another name for Satan is a question the New Testament does not decisively answer. The Gospels treat the two as functionally equivalent: 'Beelzebub' and 'Satan' refer to the same prince of demons in the same conversation. What is clear is that the name preserves the lineage from pagan idolatry to demonic deception. The gods of the nations were not nothing; behind the idols, Scripture names a real spiritual reality.
The kingdom Beelzebub claims is divided against itself; Christ's kingdom is one and is breaking in (Matthew 12:28).
