The feature that automatically unlocks a Mac when you are wearing an Apple Watch is called Auto Unlock. When the nearby Apple Watch is worn, unlocked, and authenticated, a compatible Mac can unlock after being woken without requiring the user to type the Mac’s password.
Auto Unlock depends on Apple’s Continuity ecosystem and short-range wireless communication. The Mac and Watch must have Wi-Fi and Bluetooth enabled, use the same Apple Account, and have two-factor authentication enabled. The Watch must also have a passcode and be worn by its owner. Apple uses proximity and the Watch’s authenticated state as evidence that the person near the Mac is authorized.
Auto Unlock does not eliminate every password check. After a Mac is restarted, logged out, or initially started, macOS requires the account password manually. The Apple Watch can later unlock the session and can also approve some administrator-password requests by double-clicking its side button. This feature is distinct from using an Apple Watch to unlock an iPhone while wearing a mask.