When a new contact is created, any of the unique information or unique_external_id is used to create the contact entry for the requester.
When a ticket is created by the requester with unique_external_id which was not used to create the contact during their first ticket, it’s not updated. If the email is available, the contact is found and mapped to the ticket using the email address.
Only when creating the contact for the request for the first time, the unique_external_id is stored and the requester can be found later with the same.
If it’s not in your control how the user sign in when creating their first ticket and unique_external_id is not captured, you would have to manually update them with Update Contact API if you need it to be updated for contacts saved with other unique identification.