It's such a classic device, isn't it? I think its main power lies in forcing the protagonist, and the reader, into a state of constant unease. A standard nightmare might fade, but a dream that keeps coming back, with the same grotesque details, suggests something is breaking through from somewhere else—or from within the character's own buried trauma. In something like Stephen King's work, it's rarely just foreshadowing a literal demon; it's the character's subconscious trying to scream a warning they're consciously ignoring. That gap between what the dream might mean and the character's frantic attempts to rationalize it creates delicious suspense.
From a plotting standpoint, these dreams act as checkpoints. They can reveal a new clue each time, a fragment of a memory or a symbol that gains meaning only later. But honestly, I'm more fascinated by the slow corrosion of sanity. When the character starts fearing sleep more than being awake, when the line between the dream world and reality blurs, that's where true psychological horror lives. It's less about the demon in the dream and more about the demon the dream creates in the waking mind.