Put simply the radio broadcasts a sort of hello message to the tower so the tower knows where to listen (this is about signal direction or beam shaping, but imagine the eye of Sauron swiveling to see Frodo). This includes the identifier of the handset, the IMEI number, so that the tower can keep track of who is who. The second step of getting connected to the network is done with the details inside the SIM card, specifically the IMSI number.
If your phone has no SIM card you can still make an emergency call. You can also have an eSIM which is a software version of the SIM card. In both cases you can bypass the SIM and get connected.
If you turn airplane mode on the radio is powered off in theory, but this is not absolutely guaranteed. It should be off, the system will report it is off, but there are fringe cases where it may still be very slightly active, usually from malware or similar things.
So no SIM means no IMSI, but the radio itself has the IMEI and that handset is hard coded to that identifier. If the radio powers on it will broadcast the IMEI to negotiate connection with or without the SIM and IMSI.