They all yearned for the power of Kingdom Hearts for themselves and created Keyblades in the image and likeness of the X-blade, only to clash in the Keyblade War: darkness conquered the worlds and Kingdom Hearts disappeared.
The royal χ-sword, destroyed by the war, was split into 20 fragments: seven fragments of pure light that became the hearts of the seven princesses, and thirteen fragments of pure darkness. When the world was revived by the lights within the hearts of the children, the last guardians decided to use the keyblades to defend that light.