Use this tag if your question pertains to Doze mode battery saving feature of Android Marshmallow and above. Doze mode should not be confused with doze modes of Ambient display setting. Both are altogether different features.
Doze is a battery saving feature introduced since Marahmallow and improved in successive Android versions.
If a user leaves a device unplugged and stationary for a period of time, with the screen off, the device enters Doze mode. In Doze mode, the system attempts to conserve battery by restricting apps' access to network and CPU-intensive services. It also prevents apps from accessing the network and defers their jobs, syncs, and standard alarms.
Periodically, the system exits Doze for a brief time to let apps complete their deferred activities. During this maintenance window, the system runs all pending syncs, jobs, and alarms, and lets apps access the network.
For more details, see Optimize for Doze and App Standby.
Apps like greenify and some apps available on Play Store which require root (or elevated privileges through adb, take the implementation to the next level, clled aggressive doze,wherein the device can be in Doze mode even when the device is not stationary.