Sora is not actually Sora. It's Xion and the game takes place within the recesses of Sora's memory, allowing him/her to visit the various worlds that Sora has been to before. Riku, meanwhile, is not actually Riku either, but a glitch in Namine's memory abilities that created an errant heart being with free will that bonded to the first coherent memory it came across, hence why it looks like Riku. Said aberration starts drawing on the memories of beings that are not Sora due to Namine's power going haywire and thus the worlds he/it can access are all-new in context of the series.
Xion's gameplay section will be spent revisiting the old worlds because all the Darkness Sora has exposed himself to (via fighting Heartless/visiting the Abyss of Kingdom Hearts/etc) is starting to manifest in his mind in unhealthy ways (it's also revealed/retconned to be the new source of Sora's AntiForm, and it's starting to eat away at Sora more and more) such as becoming Heartless and Nobodies in the context of his mind. Xion's job is to stamp out the darkness in Sora's heart - and maybe find a way to manifest herself as a separate being again.
The Memory Fragment (henceforth referred to as Riku for simplicity's sake), meanwhile, is born as a new existence with little knowledge of how he/it got here and thus begins wandering through the various worlds (some new, some old), beating up other memory fragments that also manifested itself in Sora's subconscious and are inherently hostile to him because they look like Nobodies/Heartless and Riku does not and that's just the way it works. This is eventually revealed to be slowly erasing Sora's memory again, and manifests itself from Xion's PoV as the memory-worlds she is traveling through slowly falling apart.
Eventually Xion and Riku meet, and Xion, believing Riku to be a mindless memory fragment, attempts to destroy him. The two clash into a relative standstill, until Roxas shows up.
Yes, Roxas. The 3rd, heretofore unknown playable character shows up and tries to sort things out relatively peacefully, but Riku refuses to listen and runs off into the shadows. Roxas' gameplay section (maybe with Xion as a permanent partner?) is him travelling through the 7 worlds of the seven princesses of Heart (because he's connected to Ven's Heart, which is pure Light, and the rest of the Princesses of Heart are pure Light too so that means they're connected which means Roxas can go through their memory worlds. Somehow.) to hunt down this Riku. Eventually, they run into the Final Boss of the game: Vanitas.
Yes, Vanitas. After being shattered at the end of BbS, Vanitas lingered in Sora's heart alongside Ven and slowly began to draw on the darkness in Sora's heart to rebuild his strength. Because Sora has so little darkness (to start with, anyway), it took him over 10 years to regain his power, but now he's back and he wants to take over Sora's heart completely. Riku shows up, realizes that even if he is aberration, he can still choose to do good (see? This is like, self-affirmation and stuff. It's GOOD STORYTELLING) and fights Vanitas. He weakens Vanitas, but Vanitas succeeds in stabbing him. He dissolves back into memory fragments, but those fragments get absorbed by Xion, since she's ultimately also made of memories. Xion then fights Vanitas, and almost finishes him off, but Vanitas pulls out his trump card - during the battle with Ven, he learned that Light held power also, and he somehow figured out how to draw on it. How this works with a being of pure Darkness is conveniently glossed over. Vanitas fights, defeats and nearly kills Xion but then Roxas absorbs her because she's Sora's memories and he's Sora... kind of, anyway, so he can do that and uses her power to fight Vanitas to a standstill.
Then Ven shows up and randomly hands his power to Roxas because, hey, why not? And then the finishing blow is dealt by Roxas quintuple wielding Keyblades (it sounds stupid but it will be totally awesome and not stupid at all. Honest.). This also fixes all the damage to Sora's memory because HEART POWER dammit.
Vanitas uses the last of his strength to stab Roxas in the heart, which seals Roxas away into Ven's heart. Somehow. And Sora wakes up the next morning with the trippiest dream ever. Meanwhile, inside Sora's heart Ven is trying to send Sora message that he needs to rescue Roxas who is inside his heart so he can rescue Xion who is inside Roxas' heart so he can rescue the Riku Memory Fragment inside her, um, memories. Cue the next KH game.
Yeah.