Hi Martina,
FeatureCounts matches read pairs by read names, then the "mate mapping locations" that are in the 7th and 8th columns in the SAM or BAM files, then the "HI" tag in each alignment.
The read pairing module is the essential part for making featureCounts very efficient, and the module is named "SAM_pairer" in src/input-files.c. There are many functions in this module, and the function for extracting information from reads for read pairing is "SAM_pairer_get_read_full_name". The read name generated by this function contains the raw read name in SAM/BAM files, with extra information about the mate mapping location and the HI tag value. This read name is used for finding the other read in the pair, which should have exactly the same read name.
Cheers,
Yang