When a person sleeps, they unconsciously keep changing positions to avoid the pain and tension caused by sleeping in uncomfortable ways.