usually it's when there's a wall/obstacle between my character and the npc or when the npc is on a different floor. there may be other conditions but these are the two that happen most often, which is especially annoying for quests.
here's a couple specific examples
npc behind a wall:
https://i.imgur.com/skz5x4B.jpg
(screenshot from another player's youtube vid)
the audio should be muffled but still audible, whereas i couldn't hear any of the dialogue. this happens again shortly after when Daini runs out of the room (should still be able to hear her muffled voice outside but instead i hear nothing)
npc on a different floor: in the Riften main story quest Pulled Under when you first enter the Windtorn House, you're supposed to be able to hear the muffled voice of an npc on the floor above yelling for someone to watch out, but i can't hear it
even in the Riften mages guild hall here
https://i.imgur.com/8ZPoMHO.jpg
i can't hear the npcs below simply because we're on different levels despite the center of the building being completely open
i have no problems hearing npcs under normal circumstances, but it's frustrating that i can't seem to hear them under these conditions