This is a strange occurrence that I can't for the life of me figure out. For information: I'm running a Dell XPS 13" with Windows 10.
To reproduce the issue: I will close my lid while working on something. All my settings are set so that closing lid should make my computer go to sleep. Instead though, most of the time when I reopen my laptop it will show the "Dell" boot logo like it is waking up from being shut down, and all applications I was running were closed down in the process.
It seems to me that though I have gone into the power settings for my laptop, this is a bug somewhere else. It also is recent, and started happening in the past few weeks, perhaps after an update. Does anyone else get this error on a Dell XPS laptop running Windows 10, or have a solution to it? After searching through Microsoft's online forums, I've found nothing of value.