Basically, the backward call evaluates the graph built in the forward pass and computes the gradients using the chain rule.
You can find more information here 24.
Note that in PyTorch the gradients will be accumulated, so usually you want to zero them again before calling the next backward pass.