The short version
Your Mac has three separate states that all make the screen go black, and they do very different things:
- Lock screen asks for your password. Everything behind it keeps running: apps, downloads, music, a render.
- Display off turns off the screen to save power. The Mac keeps running, and it may or may not lock depending on your password setting.
- Sleep pauses the whole Mac. Apps freeze in place, network transfers stop, and nothing runs until you wake it.
If you want work to keep going while you step away, lock the Mac. Don't put it to sleep.
What locking does
Locking puts the login window in front of your session. Your session is still there, fully awake. Press Control-Command-Q, or choose Apple menu > Lock Screen. On a keyboard with Touch ID, a short press of the Touch ID button locks the screen.
A locked Mac still follows its sleep timers. Leave it locked long enough and the display turns off, and after that the system can sleep too. Locking protects the Mac. It doesn't keep it awake.
What turning the display off does
The display-off timer lives in System Settings > Lock Screen. A MacBook has two: "Turn display off on battery when inactive" and "Turn display off on power adapter when inactive."
Whether the Mac locks when the screen goes off is a separate setting on the same page: "Require password after screen saver begins or display is turned off." Set it to a delay and you can wake the screen within that window without typing your password.
What happens to the rest of the Mac after the display turns off depends on one more switch. On a MacBook it's in Battery > Options: "Prevent automatic sleeping on power adapter when the display is off." On a desktop Mac it's in Energy: "Prevent automatic sleeping when the display is off." With it on, the Mac keeps running with a dark screen. With it off, the system can sleep soon after the display does.
What sleep does
Sleep is the low-power pause. Choose Apple menu > Sleep, or press Option-Command-Power. Closing a MacBook lid without an external display also sleeps it.
Waking is fast and your apps come back where you left them, but while the Mac sleeps nothing moves forward. A download stalls, a remote desktop session drops, and chat apps mark you away.
Which one to use
- Stepping away for coffee with a download running: lock it.
- Leaving for the night with nothing running: sleep it, or let the timers do it.
- Want the screen dark but the Mac working: let the display turn off and turn on "Prevent automatic sleeping" while plugged in.
Keep it awake only when you need it
The catch with the built-in switches is that they're on or off all the time. Shake It On keeps the Mac awake by moving the cursor slightly, but only under the rules you set: while plugged in, while a chosen app runs, during your work hours. One of its Paused When conditions is "display off or locked," so if you turn that on, locking your Mac hands control back to the normal timers.