Sora and Riku agree to take their Mark of Mastery exams in preparation of a new danger looming in the horizon. Those who fulfill the exam and become Keyblade Masters will be granted a new power. The two are tasked with traveling to worlds that had been previously ravaged by the Heartless and are stuck in a "sleeping" state, essentially disconnecting them from other worlds.
Within these worlds exist entities called Dream Eaters. The Dream Eaters born from darkness are called Nightmares and seek out the world's keyholes to prevent the worlds from waking. However, the Dream Eaters born from light are known as Spirits and work alongside Sora and Riku to reawaken the worlds.
As Sora and Riku travel between the worlds and unlock the seven Sleeping Keyholes, they encounter several foes from their past that were long believed to be slain, including Ansem and Xemnas, as well as a unknown man in a black coat.
SPOILERS!
Upon arriving at The World That Never Was, the intentions of the remaining Organization XIII is revealed. Master Xehanort has been revived and is gathering vessels to place pieces of his Heart in, essentially creating duplicates of himself. Using these duplicates, he intends on clashing with the seven Keyblades of Light and sparking a new Keyblade War.
Riku was originally chosen as a vessel but was able to manipulate the darkness in his heart, so Sora is next on the list. Falling into a comatose state, Sora loses his heart to darkness and is faced with the possibility of never reawakening. Riku and Mickey are able to battle with the unknown man (a younger Xehanort that has been manipulating time travel) to prevent Sora from becoming a vessel.
Now in order to awaken Sora, Riku must dive into his heart and battle the darkness within. Once awakening, Yen Sid evaluates the two on their progress with the exam (despite being hijacked by the Organization XIII along the way).
Although both performed admirably, only Riku passes and becomes a Keyblade Master. Understanding he requires more training, Sora embarks on his own journey to become stronger.
Additionally, Yen Sid begins to gather the seven Keyblades of Light to prepare for the inevitable: the next Keyblade War. Lea (the human form of previous Organization XIII member Axel) reveals himself as a new Keyblade Wielder, and Kairi is also brought in to begin her training.