Locked phones check the carrier ID on the SIM to make sure it matches the carrier ID they are locked to. This is why you can’t just put whatever SIM you want into a phone unless it’s unlocked.