Master Xehanort used his keyblade to withdraw his own heart and possess Terra. After the X-Blade broke and Terra's animated armor knocked Xehanort unconscious, he was sent to Radiant Garden. Confused as to who he was, he attacked and was defeated by Aqua, which sent him falling into the Realm of Darkness. Aqua dove in to save him at the cost of her keyblade and armor, and ended up falling in his stead. This resulted in him losing his memory and being found and taken in by Ansem the Wise as one of his apprentices. After studying the heart, he became obsessed with the Door To Darkness and heart of all worlds and ended up regaining his previously lost memories.
He and the other apprentices turned themselves into heartless and therefore, nobodies as well. His heartless took his former master's name, Ansem while his nobody chose the name Xemnas. With the help of the other former apprentices of Ansem the Wise, Xemnas formed the nobody group known as Organization 13. The group intended to hook 13 nobodies to Kingdom Hearts and fill them all with hearts so that they may become whole again, while Xemnas planned to fill them all with Xehanort's heart and mind. During this time, Xemnas would visit and speak to Aqua's keyblade and armor which he kept locked up in a hidden room in Radiant Garden. He also found Castle Oblivion in search of Ventus, whose body was locked and hidden in a secret room there by Aqua. Xemnas' comrades had weak bodies, wills, and/or trusts. Thus naturally, the Organization never had a chance to attain their goal.
Organization 13's strong hold is in a world between light and darkness, called the World that Never Was. There Xemnas was able to create his own Kingdom Hearts from the hearts of men but thanks to Ansem the Wise, it exploded and the hearts were sent raining down. Not long after, Xemnas met his demise at the hands of Sora and Riku. The deaths of Ansem and Xemnas led to the return of Master Xehanort.
Xemnas has the ability to control Nothingness, and with that he is able to summon and wield blades of solidified Nothingness which are called Ethereal Blades. Not only is he able to use them as melee weapons, he is also able to fire them as laser-like projectiles however he pleases, for example, from his hands and surrounding his opponent. He is also able to create and manipulate barriers, orbs, and thorns of Nothingness.
Other notable abilities include being able to suck the life out of his opponent, summoning and throwing buildings via telekinesis, teleporting himself and his opponent to a location he creates, flight, becoming intangible, and creating copies of himself.