Vanitas is the apprentice of Master Xehanort and a major antagonist in Kingdom Hearts: Birth by Sleep. He is a being of pure darkness created by Xehanort. In the English language version of Birth by Sleep, he is voiced by Haley Joel Osment.
Master Xehanort had originally taken on the boy Ventus as his apprentice. Rather than raise him to become a proper master, however, he intended to use Ventus to give birth to the X-Blade Keyblade, or X-blade (pronounced the same as Keyblade). A powerful weapon of light and darkness in equal measure. In order for his plan to work, however, Ventus needed to accept and cultivate the darkness his heart; something that the boy was not willing to do.
Not to be denied, Xehanort took a drastic step by forcibly separating the darkness from Ventus's heart and gave it form. He gave this new figure a name, Vanitas, and took him in as his new apprentice. Ventus meanwhile had lost his memory, but still showed ability with the Keyblade. Finding that he still had use for him, Xehanort left Ventus in the care of Eraqus.
Vanitas's primary goal is to reunite with Ventus. Once joined together, they would be whole, and the X-blade would be his. To this end, he goads Ventus into running away from the Land of Departure and puts him on a path that would ultimately lead to the Keyblade Graveyard.
Vanitas manages to successfully merge with Ventus and becomes whole. However, because Ventus is not under his total control, the X-blade remains incomplete when he faces Aqua and Mickey. Within their shared heart, Vanitas confronts Ventus one more time with the intent to subdue him and give the X-blade its full power. However, Ventus proves too much for him. He is defeated, and the X-blade is destroyed since the X-blade is made of seven lights and thirteen darknesses.
The creatures known as the Unversed are beings born from and controlled by Vanitas. He travels to as many worlds as he can, spreading unversed as he goes in order to lure out Ventus, Terra, and Aqua so that they may all fall into the trap of Master Xehanort's machinations.
For the vast majority of the game, Vanitas remains masked. Ventus, Terra, and Aqua all encounter the masked form of Vanitas at least once.
The Lingering Sentiment
When Vanitas possesses Ventus's body, he becomes what the game calls the Lingering Sentiment. The Lingering Sentiment is only encountered once as the final boss of Aqua's story.
Unmasked, Vanitas's appearance is almost identical to that of the original Kingdom Hearts protagonist, Sora, save for his black hair and yellow eyes. Vanitas unmasks himself following his first fight with Ventus at the Keyblade Graveyard.