Brief periods of sleep-talking (somniloquy), mostly gibberish, are quite common, particularly in children. It is not typically useful to call something a "disorder" unless it is causing a problem. Aside from disturbing others, sleep-talking is rarely problematic by itself, but in combination with other parasomnias (behaviours that indicate arousal during sleep) may be symptomatic of a more concerning sleep disorder.
Sleep-talking while dreaming is most often associated with REM sleep. However, note that not all sleep-talking happens while dreaming, and both dreaming and sleep-talking may also occur during transitions from non-REM sleep to waking state (partial arousal).
REM sleep normally involves a loss of voluntary muscle movement, referred to as REM sleep atonia, that prevents dreamers from physically interacting with their dreams:
When the body shifts into REM sleep, motor neurons throughout the body
undergo a process called hyperpolarization: their already-negative
membrane potential decreases by another 2–10 millivolts, thereby
raising the threshold which a stimulus must overcome to excite them.
Muscle inhibition may result from unavailability of monoamine
neurotransmitters (restraining the abundance of acetylcholine in the
brainstem) and perhaps from mechanisms used in waking muscle
The process involved with REM sleep motor inhibition is complex and not fully understood, but presumably, a deviation from or malfunction in this process may result in temporary partial loss of atonia, or partial arousal during non-REM sleep, that can trigger sleep-talking. Causes of such anomalies include medication, alcohol and drugs, illness, genetics, mental disorders, and stress. Of course, partial arousal can also be triggered by external stimuli.
When associated with more complete loss of atonia, and occurring nightly or even multiple times a night, sleep-talking while dreaming is a common symptom of RBD, a sleep disorder in which patients act out their dreams. As RBD is itself potentially a symptom of a degenerative neurological disorder, significant chronic loss of atonia, including vivid sleep-talking, particularly in the elderly, would be more concerning than sleep-talking on its own.