It's kind of messed up. One time I killed a sim when she was visiting a lot where 8 others lived, two of those sims got the sad moodlet and they had literally just met her... meanwhile one of the sims who lived with her got absolutely nothing, even though she witnessed the death. It was super weird having these two girls just autonomously go weep at her grave every other sim hour, when they barely even knew her...
I really like how the memory system in TS2 handled death. Sims would sometimes just randomly reminisce about a friend or relative who died a long time ago, even if it happened several life stages ago. The death stayed with them forever and it honestly felt so realistic. Wish TS4 had that.