basically, a SIM is what connects your phone to your mobile provider's network. Any time you want to use that infrastructure (the phone turns on, you turn off airplane mode, you turn on your eSIM) your phone makes a request to the network, which requires an authentication via the IMSI number provided by the SIM. When this happens, your location is triangulated and your status as a cell network subscriber is verified. this process also happens periodically, and more frequently if you're on the move. The technical reason for this is that your phone needs to know which towers to route requests to, and that you are paying for the service.
Theoretically, your phone is capable of being triangulated even without a SIM. However, for this to happen (outside of calling emergency services) as far as I'm aware this requires some sort of device compromise and is therefore out of most people's scope. If you're paranoid of tracking, remove your sim (or disable it if it is an eSIM) and if you're super paranoid, grab a faraday bag to put it in.
let me know if i didnt explain anything well enough.