Macbook Air shutting off on lid close
Interestingly enough, I recently swapped my 17" Macbook for a 13" Retina. Every time my 17" would run out of battery (while in sleep mode), my computer would go into hibernation. Recently, it has been shutting down completely.
After doing some digging, I found out that because I use an app to prevent my SD card from being ejected (I'm using it as additional storage), it's causing issues with the deep sleep option of macOS.
If the issue comes back, take a look at these links that may offer insights into this.
More on macOS hibernation: Do MacBooks have a true "Hibernate" option?
A handy (and free) hibernation widget/app: Can Macs be put in hibernation voluntarily?