There are 2 settings of interest around this, the Battery Saver mode and the Battery Optimization settings.
Battery Saver is something that the user can activate manually to reduce battery consumption when needed, and also automatically activates when the battery is at a critical level, perhaps 10%, 5%, or another preset level. Battery Saver, among other things, will turn off the background data of most apps.
Battery Optimization is a separate setting that the device automatically turns on for some (most?) apps. It applies the same background data restrictions as Battery Saver mode, but is active all the time, regardless of how much battery is available! To review the list of apps that are being "optimize", and to disable this feature for your email app, click on the Battery Optimization selection in the Battery Saver menu.
https://support.google.com/nexus/answer/6187458?hl=en
Use battery saver mode
To save power whenever your phone or tablet battery gets low, you can set battery saver to turn on automatically. You can also turn on battery saver mode at any time.
Note: Some of these steps work only on Android 7.0 and up. Learn how to check your Android version.What changes when battery saver is onWhen battery saver is on, the top and bottom of your screen turn orange.
To save power in battery saver mode, your device:
- Can’t use Google Maps Navigation
- Limits vibration, location services, and most background data
- May not update email, messaging, and other apps that sync, until you open them
- Open Quick Settings or your device's Settings app .
- Tap Battery Battery saver.
Tip: In Android 6.0 and lower, tap Battery More Battery saver. - Choose what you'd like to do:
- To turn battery saver on or off, tap the On/Off switch.
- To have battery saver turn on automatically, tap Turn on automatically, and pick:
- “Never”
- "at 5% battery"
- "at 15% battery"
Tip: Battery saver turns off automatically when your device is charging.
https://support.google.com/nexus/answer/7015477?hl=en
Keep battery optimization on
To have apps use your device’s battery only when they need to, keep battery optimization on for all apps. Battery optimization is on by default.
Note: Some of these steps work only on Android 6.0 and up. Learn how to check your Android version.When battery optimization is onTo save battery, apps aren’t as active when:
- You aren't using your device.
- You haven’t used the app for a few days.
Check that battery optimization is onTo confirm that an app is set to use battery only when necessary:
- Open your device's Settings app .
- Tap Battery More Battery optimization.
- Tap the Down arrow . Choose Not optimized.
- If an app is listed as “Not optimized,” tap the app Optimize Done.