Why does my laptop shut down overnight? Whenever I leave my MacBook Pro (Retina, 13-inch, Early 2015) unattended (plugged in, or not) overnight (or for long periods of time) it shuts down by itself. When I open the lid it boots up to the FileVault password screen. It seems that if the lid is up, the laptop does not shut down. 

It is running the latest and greatest macOS Sierra build (10.12.3 (16D32)). 

There is no kernel panic, and I cannot find anything in the logs or settings that would cause this behavior. I tried searching and did a SMC reset.

EDIT

log show --style syslog --predicate 'eventMessage contains "shutdown cause"'
Skipping info and debug messages, pass --info and/or --debug to include.
Filtering the log data using "eventMessage CONTAINS "shutdown cause""
Timestamp                       (process)[PID]
2017-02-08 09:54:22.064782-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 3
2017-02-08 20:07:46.801647-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2017-02-10 07:52:07.041401-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 0
2017-02-10 19:10:11.005920-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 0
2017-02-11 10:17:08.462940-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2017-02-12 10:22:55.834601-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 0


EDIT 2
It turned out that the batteries on the laptop were failing. We sent the laptop to Apple for fixing under Apple Care.
Your "Shutdown Cause" has three separate values:  0, 3, and 5.


"5" is a clean shutdown 
"3" is a dirty shutdown meaning the power button was held for 3 seconds or more
"0" means power loss


(contrary to what you'd think the values "should be", I know...)

There's an answer here on Ask Different that addresses the shutdown causes:  Are OS X shutdown cause and sleep cause numbers listed/explained anywhere?

A power failure on a "desktop" Mac (iMac, Mac mini, Mac Pro) is easily explained.  However, since you have a laptop (MacBook Pro), it's very concerning because if your electric current is cut, your battery will kick in and if that battery gets too low, it will save a hibernation image.  

The 0 is as if you had no battery and pulled the plug - the system just cut out.  I would take it in and have a look at it.  This is definitely not normal behavior.