If the entire drive is erased, the Mac will need to reactivate with Apple servers. During the activation process, the servers will check whether the Mac is registered in Find My Mac. If it still is, the servers will refuse to activate the Mac (imposing Activation Lock) until the owner's Apple ID and password are provided.
For Apple silicon Macs (M1 family and future), every installed copy of macOS has a boot security policy, called the LocalPolicy. In order to boot macOS, the LocalPolicy must be signed using special keys stored in the Secure Enclave. These keys change when:
- System Preferences -> Erase All Content and Settings wipes all data,
- All copies of macOS are removed,
When the new keys are created, they first need to be certified by Apple so that the LocalPolicy is trusted at startup. The activation process is simply the process of getting those keys certified. Once the keys are certified, they sign the LocalPolicy, and the Mac can then start up normally.
For Intel-based Macs with the T2 Security Chip, I don't know the specifics, but the T2 Security Chip stores an activation certificate from Apple that is likely destroyed when the entire Mac is erased. Without the activation certificate, the Mac will refuse to boot macOS.