The Keyblade War (キーブレード戦争 Kīburēdo Sensō ) is a legendary conflict that occured long before the events of the Kingdom Hearts series, yet is a major driving force behind the events of the Dark Seeker Saga.
 The conflict
In the "age of fairy tales", the World was whole and full of light, which was believed to come from Kingdom Hearts, which was protected by its counterpart, the χ-blade. Over time, people came to desire the power of Kingdom Hearts, introducing darkness into the World.
In order to take control of Kingdom Hearts, many people forged Keyblades in the image of the χ-blade, and they clashed together in a far-reaching conflict that embroiled the entire World. In the end, darkness covered the World, the χ-blade was shattered into twenty pieces, seven of pure light and thirteen of pure darkness, and the "true" Kingdom Hearts disappeared into the darkness.
However, the World was restored by the light within the hearts of children, but as many individual worlds separated from each other. The remnants of the battlefield on which the Keyblade War took place became the Keyblade Graveyard, a scarred wasteland filled with the Keyblades of fallen warriors. The remaining Keyblade wielders resolved to protect the World from further destruction, becoming guardians of the World order.
The story of the Keyblade War was passed into legend, and the Keyblade was depicted both as a bringer of chaos and destruction and as a weapon to save the World.
 Xehanort's interest
Generations later, a Keyblade Master named Xehanort researched the Keyblade War and decided to unlock the mysteries of what took place at the Keyblade War's end through creating the χ-blade, summoning Kingdom Hearts, and setting off another Keyblade War. His motivation was to recreate the World as a balance between light and darkness, a balance he believed was lost in the current World. Xehanort discussed his interest with his colleague and fellow former student, Eraqus, but Eraqus tried to stop him, believing Xehanort to be giving himself over to darkness.
Years later, Master Xehanort attempts to forge the χ-blade by pitting a heart of pure light and a heart of pure darkness against each other. To that end, he forcibly removes the darkness from the heart of his pupil, Ventus, creating Vanitas. When Ventus barely survives the process, Xehanort leaves Ventus in the care of Master Eraqus, hoping that his light would become strong enough for him to face Vanitas. Eventually, he manipulates Ventus into fighting Vanitas at the Keyblade Graveyard, and the two fuse, creating the χ-blade. However, the union is imperfect, and the χ-blade is destroyed by the combined efforts of Ventus and Aqua.
As a secondary plan, Ansem, Seeker of Darkness, prior to obtaining Riku's body as a vessel, travels back in time and meets with Master Xehanort's younger self, sending him on a mission to create an organization of thirteen different incarnations of Xehanort, thirteen darknesses for Master Xehanort to pit against seven lights, as the true method of recreating the χ-blade and starting another Keyblade War. The new Organization XIII comes to include Master Xehanort, Young Xehanort, Ansem, Xemnas, Xigbar, Saïx and six more hooded figures. Master Xehanort's plan to make Sora into the final vessel for his essence is foiled when Riku, Mickey, Lea, Donald and Goofy intervene, and the twelve current members disappear, returning to their proper points in time for the time being.