Thanks for the answers guys. However now I'm more confused that before!
According to konny:
It seems to be related to the class of the unit that suffered from casualties, not the one that caused them.
Isn't this weird and contradictory to common sense?

Medical Toaster:
the first units to take casualties are the ones that are healed the most
Does this mean the first couple of units or the first X(for example 60) soldiers of any unit? This may explain the incident I mentioned in the first post.

recovery rates are also influenced by the hardy and very_hardy attributes...
I didn't know that. I assume that hardy units heal more units and very hardy even more.