It is ALL About WAR.
Yahweh is the “God of War” …
Throughout the mature Old Testament narrative, God is constantly invoked as a God of War. When Moses leads the Israelites out of Egypt, the jubilant Israelites sing to God, calling him a “man of war”: “The LORD is a man of war.” The triumph of God in the Exodus narrative is battling with Pharoah’s army and defeating it—a characteristic of war god literature also tied to the Kenite-Midianite thesis of Yahweh’s origin as an Arabian war deity (Moses meets God in the direction of Arabia and his father is a Midianite, etc.). When the Israelites enter Canaan, Joshua is their warlord leader and most of God’s commands to Joshua and the Israelites are militaristic in nature, furthering the depiction of God inherited from Moses and the Exodus.
Yahweh - God of War …. how Yahweh became the sole deity of Israelite/Judahite worship, at least within the royal court, reliance on the Biblical narrative is key. And the Biblical narrative, as believers and critics alike recognize, is one centered around WAR.
Exodus is filled with violence. Joshua is filled with violence. Judges is filled with violence. 1 and 2 Samuel are filled with violence. In other words, war is what led to the creation of a United Israel with the central cult in Jerusalem, a city conquered by David, whose son, the child of a long warrior tradition, dedicates the Temple to the “God of My Fathers” (Yahweh). Since this kingdom came into existence solely through WAR , the other deities (namely El, but also Baal and Asherah) become persona non-grata. Redactors following the Deuteronomic Reforms cast scorn on the other gods who were unimportant to Israel/Judah’s formation. Thus Baal and Asherah, most prominently, become idols to the Yahweh cult in Jerusalem. (Though Baal and Asherah are also militaristic deities as a side note.)