After completing both halves of the town, Joshua begins to speak on the other characters you met. He dreamed them up so that they could have another chance at existence, once he found that dreams take a physical form in this world. It obviously isn’t that simple - to exist, your existence must be noticed by others.
Sora and Riku helped that to happen by uniting the towns and letting each person, with their connected hearts, find each other: Beat and Rhyme, Neku and Shiki… Suddenly, as Joshua flies off, the Sleeping Keyhole appears and it becomes unlocked…
Flashback: The Task Ahead
All dreams are connected, so the first Sleeping World needed to be chosen. The Destiny Islands, prior to being engulfed by darkness, was set to be where they would begin. They’d let things run their course, and let the dreams guide them to the Sleeping Worlds.
For each light part of the X-blade, there is one Sleeping Keyhole; seven in all. Unlocking them grants new powers, and awakens the worlds, and also releases them from the grips of darkness and slumber.
Awaken all seven worlds by unlocking the Sleeping Keyholes and return to Yen Sid’s tower in Twilight Town safely. That is their goal in the Mark of Mastery examination. Do that, and they’ll be both named true Keyblade Masters.