After Merging Contacts -> dig up a Contact in the Trash bin and you'll see something like:
Where does CiviCRM store this information? How does it track which Contact is merged with which Contact?
CiviCRM Stack Exchange is a question and answer site for administrators and users of the CiviCRM Constituent Relationship Management software. It only takes a minute to sign up.Sign up to join this community
An activity gets recorded when you merge and it looks up the target contact via that.
$winnerContact = civicrm_api3('Contact', 'getmergedto', ['contact_id' => $contactId]).