You close the lid of a MacBook in the evening and find a fuller battery drain in the morning than you expected. Before you blame an app, I’d look at what the Mac itself wrote down about the night.
pmset -g log prints a history of sleeps, wakes and other power management events. The man page calls it a log for admin and debugging purposes, which is a polite way of saying it is long. So filter it:
pmset -g log | grep -i wake
Each line starts with a date and time, followed by a short description of the event. Read the wake lines from the night in question and you can usually tell what got the Mac out of bed. Add | tail -n 40 to only see the latest entries. If you just want the numbers, there is a shorter command:
pmset -g stats
That prints how many times the system slept and woke since the last boot. A count far higher than the number of times you opened the lid is your hint to dig into the log.
This tip pairs well with pmset -g assertions, which I covered separately: assertions tell you what keeps the Mac awake right now, while the log tells you what happened earlier. On my MacBook Pro I’d reach for the log first when the question starts with “why did it”.
The caveat: the format of these lines is not documented as a stable interface, and it can change between macOS versions. Grep loosely, read the lines yourself, and don’t build a script that depends on the exact wording.
Further reading: pmset man page (ss64), pmset.1 source (Apple open source)