Once the bootloader is locked, after powering up the phone, hashes of each partitions are verified against the OEM keys. If they don't match the phone won't boot. Custom keys are also possible, so you can apply them for a custom ROM but afaik not a lot of devices support it. Pixel does support...