A SIM contains information about your cellular plan.
If you are using a physical SIM, a thief can take that SIM out of your phone, and put it into another phone – which may let them learn your cell phone number. If you then have your carrier transfer that number to the replacement phone, the thief "has your number" and may send "phishing" scam messages to it.
Physical SIMs can contain a small amount of data (like a contact list), but I do not believe that iPhones use them to store anything other than information about your cellular plan. So if your phone is locked and the criminals do not have your credentials, removing a physical SIM will not give them access to the data on your phone.
An eSIM, or electronic SIM, is stored electronically in built-in storage on your iPhone. If your phone is locked, and the criminals do not have the credentials to get in, they won't even be able to view what eSIMs you have installed, let alone transfer any of them to other phones, to learn your phone number for a "phishing" expedition.