Sleep talking, clinically called somniloquy, is extremely common — most people do it occasionally, and it can range from a single mumbled word to a full, if usually nonsensical, conversation.
Does it reflect what you're dreaming?
Sometimes, but not reliably. Sleep talking can occur during any sleep stage, not just REM (when most vivid dreaming happens), and speech occurring during deep non-REM sleep is typically unrelated to any specific dream content — more like a disconnected fragment than a readout of an internal narrative. Speech during REM sleep is somewhat more likely to relate to dream content, but even then it's often garbled, out of context, or only loosely connected to what's actually being dreamed.
Why it happens
The exact mechanism isn't fully understood, but it's thought to occur when the brain areas responsible for speech become briefly active during a sleep-stage transition, without the full waking coordination that would normally accompany actual communication — similar in spirit to a confusional arousal, but localised to speech rather than full-body movement and confusion.
Who does it more
It's more common in children, who often grow out of frequent episodes, and tends to increase during periods of stress, sleep deprivation, fever, or alcohol use. It also runs somewhat in families, suggesting a genetic component alongside these situational triggers.