That sudden jolt you feel before falling asleep is called a hypnic jerk. Scientists believe it happens because the brain misinterprets relaxation as falling, triggering a quick muscle spasm to “catch” you.
Some experts think it’s a leftover survival reflex from when our ancestors slept in trees and needed to prevent themselves from falling!