Backpropagation answers one question: how much did each weight contribute to the error?
Without an answer you would be guessing which of millions of numbers to move.
It works by applying the chain rule from calculus, which is how derivatives compose.
The chain rule says a small change here causes a change there, times a change further on.
So it starts at the loss and walks backwards through the network.
At each layer it computes how the loss would change if that layer output slightly more.
That is combined with what the layer stored on the forward pass to give the weight gradients.
The same quantity is passed further back so the previous layer can do the same.
One backward pass gives every weight in the network its own gradient.
It costs roughly twice a forward pass, no matter how many parameters there are.
That efficiency is the entire reason training large networks is possible.
The gradients are then handed to the optimizer, which decides the actual step.
Backpropagation computes direction, and the optimizer decides how far to go.
Frameworks build the graph of operations as you go and differentiate it automatically.
You almost never write it yourself, but knowing it explains vanishing gradients immediately.