why do we twitch when we sleep

just now 1
Nature

We twitch when we sleep, especially as we are just falling asleep, due to something called hypnic jerks (also known as hypnagogic jerks or sleep starts). These are sudden, involuntary muscle contractions that occur during the transition from wakefulness to sleep. The brain sometimes sends mixed signals during this transition, possibly mistaking the muscles relaxing as a sign that the body is falling or losing balance, which triggers a reflexive muscle jerk. These twitches are normal and generally harmless. Factors that can increase the likelihood of twitching during sleep include stress, anxiety, caffeine or stimulant intake close to bedtime, physical exhaustion, and lack of sleep. Twitching serves as a natural part of the sleep process and may even provide sensory feedback to the brain during sleep.