The War Among the Gods was a conflict that occurred between the xel'naga loyal to Amon and the xel'naga who stood for the Infinite Cycle. It resulted in massive casualties on both sides, and the assimilation of the xel'naga's knowledge by the Overmind.
Having failed with the protoss, Amon and his followers decided to focus on uplifting a species with purity of essence in order to create false xel'naga to help them end the Infinite Cycle. They moved to the world of Zerus, and uplifted a species named the zerg. When it was clear that they were independent and would not follow, however, Amon decided to bind them to an overriding will named the Overmind. However, during their experiments, the Khala was created on the distant world of Aiur. Its spark was great enough to disturb the slumber of the xel'naga in Ulnar, who felt Amon's absence in the Void. They wandered out, discovering Amon and his followers' experiments at Zerus. Appalled by what their brother had done, the xel'naga moved their worldships to stop Amon's plans.
A brutal war began in the skies over Zerus, and Amon released his final weapon against his kin; the zerg swarm. The swarm overran the xel'naga, destroying many of their worldships and nearly wiping them out. It was not enough, however, and in the final battle Amon was banished back into the Void. Though weakened, there were still a number of surviving xel'naga still loyal to the Infinite Cycle, who returned to Ulnar to slumber.
In the aftermath, the Overmind assimilated much knowledge from the xel'naga, including the existence of a race that could bring them purity of form, and thus perfection. Given an overriding drive to perfect the swarm, the Overmind left Zerus and sought out the protoss race. Meanwhile, a surviving xel'naga loyal to Amon, Samir Duran, schemed as to how to use the conflict between the zerg and the protoss to revive his banished master, as well as to seek a body to sustain him.