What happens when I have cramps in my toes in bed?

If you sleep on your back for long periods of time, the top of your feet are compressed by the blanket, or if you lie prone for long periods of time with the top of your feet against the bed, forcing some of the muscles in your feet to be in a state of absolute relaxation for long periods of time, which may cause a muscle “passive contracture”.