Skyrim once featured a haunting and mourning system for NPCs, but the feature was disabled by Bethesda.
Digging around in the game files, modder vagonumero12 found the lines of code and have restored each world interaction event into the game as a mod.
Here’s how the restored content works per the Nexus Mods page:
“Haunting: when an unique NPC with family dies, there will be a random chance that it will -after some time- “resurrect” as a ghost that will follow a relative for the rest of the game. Only NPC with generic voice files (don’t expect to see Ulfric as a ghost), and only a single NPC in the whole save. You won’t be able to fill Skyrim with ghosts (it was left like that by Bethesda).”
“Mourning: when an unique NPC with family or friends dies, their relatives/friends will do some comment about their loss to you on their hello dialogues.”
All the lines of dialog you hear in the mod were recording by the voice actors, so don’t be shocked when you interact with children mourning the loss of a spouse.