When merge event occurs, in the deleted records, MasterRecordId field will be populated with the winning record id. The winning record will be updated with the values selected.
The losing records will be deleted and will be available in Recycle Bin.
Check the below links for more info,
https://www.infallibletechie.com/2013/08/merging-in-salesforce.html
https://www.infallibletechie.com/2014/08/merge-trigger-example-in-salesforce.html
Cheers!!!