Hi. I have a MacBook Pro 2021 and when I close the lid it doesn't automatically lock macOS like my old MacBook which means it can be a security risk. I'm sure it's simple but can't work it out how do you set this option?
You may check –> System Preferences –> Battery –> Power Adapter for prevent Mac from sleeping
and –> System Preferences –> Security and Privacy –> General for password options
In 2023, on a 2021 MacBook running macOS 13.5.1, I enabled that automatically lock when I close my lid setting by navigating through System Settings→Lock Screen→Require password after screen saver begins or display is turned off menus, then setting to Immediately—see screenshot.