Let's say I'm a troll. Trolls have regeneration 5/ acid or fire.
That means that only acid or fire will deal lethal damage to me. Any other kind of damage, be it slashing, piercing, sacred, dessication, city, et cetera, is instantly converted to nonlethal damage. You could drop the moon on me and I'd be still alive. Unconscious, but alive.
In addition to that really cool ability granted by my regeneration, I have a secondary one. On each and every one of my turns, I heal 5 points of nonlethal damage.
Now, let's say instead I'm a hydra instead. Hydras have fast healing 15. That means on my turn, every round, I heal up 15 points of damage. That's pretty cool.
If I have both lethal and nonlethal damage, my fast healing is a lazy bastard and cures nonlethal damage first. So if I have 13 points of nonlethal damage, and some amount of lethal damage, on my next turn fast healing will cure up all my nonlethal, and only 2 points of my lethal.
Oddly enough, if someone casts a healing spell like cure minor wounds on me when I have both lethal and nonlethal damage, it'll cure the full amount of both (so 1 lethal and 1 nonlethal for cure minor)