Q: How did the Organization XIII members come back as humans?
A: As explained in Re:Coded, when someone becomes a Heartless their body is extinguished. When their Heartless is slain, it releases the captive heart. This heart then rejoins with the once extinguished body on whatever world it was that they originally lost their heart on. In the event that their world is destroyed or lost, the heart and body will instead rejoin in Traverse Town. This person will reawaken as a complete being.
If someone had a strong heart when they became a heartless, instead of extinguishing, the body and soul awakens on a world in the InBetween Realm as a new creature—a Nobody. If the body and soul are in the form of a Nobody when their Heartless is defeated and their heart set free, it will resort to a state of suspended animation until the Nobody half has been vanquished, at which point it will return to the body and that person will be recompleted.
In essence, once both the Heartless-half and the Nobody-half have been defeated, the individual will reawaken as a complete being.
This natural process was deterred, however, with the creation of the Organization’s Kingdom Hearts. As a result, released hearts do not return to their former body, but instead join this false Kingdom Hearts. Many of the members hearts had been freed by Sora and co. but because of the Organization’s Kingdom Hearts, they could not return to their bodies.
By defeating Xemnas, Sora set Kingdom Hearts free, allowing all of the captured hearts to return to their rightful places. This led to the Organization members to reawaken as complete beings at relatively the same time. Whether or not every Organization member has been recompleted is yet to be seen.