Like the others have said, separation/transformation into Heartless and Nobodies has nothing to do with death. It always SEEMS like death because in order to separate or combine back into your original self, your corporeal vessels have to be destroyed, which in most other franchises would simply equal termination. Anatomically, "death" in the KH universe is what happens when both a person's body and soul are destroyed. If the body (one's physical form) can be destroyed or cease to function, then the soul (one's identity, mind, personality, etc.) fades away as a result, like the flame of a candle being snuffed out when the candle itself has completely melted away. This leaves only the heart (one's primary essence) to escape the mortal coil.
There are several transformations that can take place when darkness interacts with an individual in the KH universe:
First, a person can become a "dark acolyte" (this is just a term I made up because we still don't have an official term to use for these characters). These are people who allow their hearts to become tainted by darkness, but retain the integrity of their anatomical constitution. Think evil KH1 Riku, Anti-Aqua, or Master Xehanort. These are characters whose hearts become infused with darkness to the point that their bodies, their physical forms, begin to exhibit changes. Usually, these changes take the form of yellow eyes, but in the case of Riku and Anti-Aqua, some people who've gone beyond the pail and actually succumbed to the dark influences (as opposed to Master Xehanort, who wielded some measure of control over the darkness in his heart) can grow those weird sinewy suits.
The next step up is transformation into a Heartless. And this seems to happen in one of two ways. A) A pre-existing Heartless attacks a human and removes their heart from their body (à la the shopkeeper from Traverse Town in KH1), consuming it and entrapping it—in this event, the person's soul and body both perish due to the absence of the heart; or, B) A person succumbs in their heart and soul to the darkness. We saw this with the guards at the imperial palace in Land of Dragons. Even though no Heartless seemed to attack these individuals, it's clear that these soldiers, exhausted from war and travel, gave in to the feelings of apathy and resentment (I assume) that were eating away at their souls. Here, I believe, the souls gave out first, which allowed for the transformation of their physical forms into that of Heartless.
And, of course, with some individuals, transformation into a Heartless does not necessarily entail the destruction of the soul or body. In these instances, even if the heart itself gets snatched away/succumbs to darkness, the body may persist if the soul fails to expire. It is the soul that animates the body, after all. These creatures, the Nobodies, are essentially the bodies of those who've lost their hearts, but because some small part of their soul—of their mind, memories, personality, OR identity—remains, they are allowed to continue to function, even though they no longer hold a heart which forms the essence of who they are. However, if a being can think and act and experience, then over time those experiences develop into brand-new hearts, and the Nobodies themselves effectively become their own types of people, distinctive phenotypical traits and special abilities notwithstanding. In the case of certain Nobodies, enough of their soul remains that, rather than simply acting like mindless automatons, they actually retain character traits, physical features, and personalities of their original selves, depending on the strength of their will.