Do you mean how the auto connection happening in GitHub project UART to BLE (https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Day020_BLE_UART) ?
If then, its upon checking the adv data. Please check in the CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT of Central project.
if((advReport->eventType == CYBLE_GAPC_SCAN_RSP) && (advReport->dataLen == 0x06) \
&& (advReport->data == 0xff) && (advReport->data == 0x31) \
&& (advReport->data == 0x01) && (advReport->data == 0x3b) \
&& (advReport->data == 0x04))
peerDeviceFound = true;
Thus the peripheral BLE component the adv data is set the same.
As soon as Central receives adv packet , it will check the adv data , and if same as expected it will send connection request.