The Keyblade War was an event that happened many years before Kingdom Hearts: Birth by Sleep. Master Xehanort was very interested in the event, and it caused him to take many of the actions that he took.
Years before the events of the Kingdom Hearts series, many people started creating Keyblades in order to take control of the X-blade, the key to control over Kingdom Hearts. This lead to a full-out war, where many people sided with others over who would gain control of the X-blade. Eventually, however, the war ended, and everything was plunged into darkness. The X-blade was broken into twenty pieces, the Seven of light and thirteen of darkness. In addition to this, the real Kingdom Hearts disappeared into the darkness.
The light that was held inside the hearts of people on each world kept the darkness under control, but it also made it so that each world was separated. The remaining wielders of the keyblade were now left to protect the worlds from anything that can cause any more destruction. What was left of the the Keyblade war became known as the Keyblade Graveyard, a battleground full of the keyblades of warriors that perished in the war.
Years after the war took place, Xehanort found out about the story of the Keyblade war, and he decided that he would once again create the X-blade and take control of the real Kingdom Hearts.
Related Threadskeyblade wars discussion "spoilers" - last post by @ Aug 1, 2006
will it be Kingdom Hearts 3? or Keyblade Wars? (Huge Spoiler Alert) - last post by @ Aug 12, 2007
Keyblade and Keychains Question - last post by @ Jan 24, 2007
How many Keyblade wielders are there? - last post by @ Mar 2, 2013
decleration of war - last post by @ Apr 16, 2003