Oh alright then, basically it's instinct. Even though you're asleep, you're brain is still smart enough to know when you're in danger of falling out of bed, and to prevent it from happening.
my stepdaughter falls out of bed all the time. I think that it comes with experience. So if you fell enough times in the past, even in your sleep you'll remember to be careful.
I was told once that in an old peoples home the male patients were given a drop of scotch and a viagra tablet before bed. The scotch helped them sleep and the viagra stopped them rolling out if bed.
When you're in a deep sleep your muscles are completely relaxed and thus, you're effectively paralysed. It takes a muscle being tensed to move any limbs etc.
No comment on the REM sleep, twitches etc. as this blows my theory out of the water. Nobody really moves *that* much when they're sleeping do they?