Energy Saver / Battery
On a desktop Mac, go to System Settings and then Energy Saver. On a MacBook, it's System Settings and then Battery. This is where macOS controls when your Mac sleeps.
The main setting is "Turn display off after," which is a slider from 1 minute to Never. On laptops, you'll see separate sliders for "On Battery" and "On Power Adapter." There's also "Prevent automatic sleeping when the display is off," which keeps the system running even after the screen turns off.
These settings are global. Whatever you set here applies all the time. There's no built-in way to say "turn off after 5 minutes at night, but never during work hours." You pick one timeout and it sticks.
Display sleep vs. system sleep
These are two separate things, and the distinction matters. Display sleep turns off the screen. System sleep puts the entire machine into a low-power state where background processes stop, network connections drop, and the Mac essentially hibernates.
By default, macOS puts the display to sleep first, then the system follows a few minutes later. You can control display sleep timing with the slider mentioned above, but system sleep timing is less transparent. On laptops, the system generally sleeps shortly after the display does, unless "Prevent automatic sleeping when the display is off" is checked.
If you want the screen off but the Mac running (for a long download or a remote connection), you need to explicitly enable that checkbox in Energy Saver. Otherwise, your process will get interrupted when the system sleeps.
Lock Screen settings
System Settings, then Lock Screen. This controls two things: when the screen saver starts, and how quickly your Mac requires a password after sleeping or starting the screen saver.
"Require password after screen saver begins or display is turned off" can be set to Immediately, After 5 seconds, After 1 minute, and so on. This is separate from when sleep happens. Your Mac can sleep quickly but not lock for a few minutes, or lock instantly but not sleep for an hour.
In corporate environments, your IT department often forces this to "Immediately" via an MDM profile. You won't be able to change it.
Power Nap
Power Nap lets your Mac do certain background tasks while it's sleeping: checking email, syncing iCloud, downloading software updates, and backing up to Time Machine (when on power). It's on by default on most Macs.
Power Nap doesn't prevent sleep. Your Mac still goes to sleep normally. It just wakes up briefly and periodically to handle these tasks, then goes back to sleep. If you need your Mac continuously awake for a running process or an active network connection, Power Nap won't help.
Scheduled sleep and wake
In older versions of macOS, Energy Saver had a "Schedule" button where you could set your Mac to sleep and wake at specific times. On newer versions (Ventura and later), this has moved and is harder to find. On some Macs it's under Battery, then Options, then Schedule.
Scheduled sleep will put your Mac to sleep at the specified time even if you're actively using it. Scheduled wake will start it up at a specific time (useful for servers or media centers). These are blunt tools. There's no logic, no conditions, and they override whatever you're doing.
A better approach
All of these settings share the same limitation: they're static and global. You pick a timeout, it applies everywhere, all the time. There's no awareness of what you're actually doing on your Mac.
Shake It On adds conditional intelligence on top of your existing settings. Instead of changing your Energy Saver timeout to Never (and risking a dead battery), you leave your settings alone and let Shake It On reset the idle timer with mouse movement only when your conditions are met.
That means your Mac can stay awake during work hours, when a specific app is running, or when you're plugged in. And it sleeps normally the rest of the time. Your Energy Saver settings keep doing their job. Shake It On just overrides them selectively.