This doesn't happen frequently but it does happen often enough to ask about. If I leave my Macbook Pro on, closed, idle (and asleep) for a few hours or more sometimes I open it up to find that it has shut down. This happens even if the battery is at or close to 100%.