Scammers use SIM phishing, also known as SIM swapping, to gain access to your SIM card to control your phone. The reason for activating a SIM card lock is due to SIM phishing. This prevents someone from using your SIM on your phone or another phone without knowing your SIM unlock PIN. The lock is in the form of a PIN, which must be entered each time the phone is turned on, even if the SIM is moved to a different phone.
This is different from a phone being carrier locked, which means that a phone can only use SIM cards from a certain carrier.
A SIM card lock is a layer of security that prevents carrier services from being used unless the SIM is unlocked.