Originally Posted by
.Nensec
ItYou cast the spell, the server accepts your request and sends it off to the next process. The next process checks for conditions ( cd, forb, range, etc. ) and accepts it, sending back the OK to the server which then puts your spell on cooldown while at the same time sends another request to another process that does the healing. That process then determines the amount of healing it will do, checking the conditions again and adjusting the spell ( overhealing, debuffs, healing absorbs, etc. ) and finally it sends the result to the server.
It is between those last 2 that your target dies, talking likely < 5ms of time here to process those things if that even. The first condition check resulted true, putting your heal on cooldown. The second condition check returned false, since the target is dead.