In the begining of Babylonian mythology, their is a war between the older generation of gods and the newer generation.
Apsu and Tiamat's descendents became an unruly crowd. Eventually Apsu, in his frustration and inability to sleep with the clamor, went to Tiamat, and he proposed to her that he slay their noisy offspring. Tiamat was furious at his suggestion to kill their clan, but after leaving her Apsu resolved to proceed with his murderous plan. When the young gods heard of his plot against them, they were silent and fearful, but soon Ea was hatching a scheme. He cast a spell on Apsu, pulled Apsu's crown from his head, and slew him. Ea then built his palace on Apsu's waters, and it was there that, with the goddess Damkina, he fathered Marduk, the four-eared, four-eyed giant who was god of the rains and storms.
The other gods, however, went to Tiamat and complained of how Ea had slain her husband. Aroused, she collected an army of dragons and monsters, and at its head she placed the god Kingu, whom she gave magical powers as well. Even Ea was at a loss how to combat such a host, until he finally called on his son Marduk. Marduk gladly agreed to take on his father's battle, on the condition that he, Marduk, would rule the gods after achieving this victory. The other gods agreed, and at a banquet they gave him his royal robes and scepter.
Marduk armed himself with a bow and arrows, a club, and lightning, and he went in search of Tiamat's monstrous army. Rolling his thunder and storms in front him, he attacked, and Kingu's battle plan soon disintegrated.
Why was Marduk made king before winning the war?