The cpp engine is based on Function 59 which are similar to the python ones. They are the elementary operations that are considered.
The forward pass attaches a grad_fn to the Tensors during the forward pass. Then you have a graph of Functions stored in cpp. Accessed from the next_functions field.
When computing a backward, the engine traverses this graph. The entry point in cpp is here 85 and you can look in the same file for all the code.