There are scores of things that can cause this, namely some process running in the background, even when "asleep."
Some suspects:
- Anti-virus
- Security suites
- Network monitors
- Apps that "phone home" periodically or check for updates
- Cloud based storage that is configured such that it stays busy even when you don't really want that
- If you use software to run Windows on the Mac, that creates a whole new set of possibilities for background activity
Simple fix: keep the Mac connected to the charger when not in use overnight. This does not address the root cause but eliminates the problem of empty battery.
Diagnostic: run Activity Monitor and check the Network Tab -- Data Received and Data Sent at night before sleep and re-check in the morning, if there is a lot of Network data going back and forth all night, that is a clue. Same for the Disk Tab, record Data Read and Data Written at night and then in the morning, is there lots of disk activity overnight? Check CPU tab, sort with largest on top, take a snapshot at night, re-check in the morning, did something use lots of cpu cycles?
2011 and 2018 computers ran older operating systems and had different software installed, so behaved differently.