Ok, here's what I think. We all know that when Ventus was taken over by Vanitas, he was able to save himself, but his heart and body were ruined in the process, and his heart made his way into Sora.
But, when Sora stabbed himself, Ven's heart was also released, and since he could not find...