Training a neural network means nudging its weights so its answers get a little less wrong. To nudge a weight in the right direction, you need to know how the error, or loss, changes when that weight changes. That slope is the weight’s gradient.
With one neuron the gradient is easy to work out. With layers of neurons it is harder: a weight deep inside the network affects the output only through everything that comes after it. Backpropagation solves this with the chain rule from calculus, applied neatly from the loss back to every weight.
It runs in two passes. The forward pass computes the network’s prediction and the loss, keeping each layer’s values. The backward pass starts at the loss and works back layer by layer. Each neuron receives blame from the neurons it feeds, weighted by the connecting weights, and scales it by the slope of its own activation. A weight’s gradient is then the blame at its output end times the signal at its input end. A weight whose input was zero gets no blame, because it had no effect on the answer.
Gradient descent then moves every weight a small step against its gradient, and the cycle repeats over many examples. The size of that step is the learning rate.
Blame can shrink as it flows back through many layers, so the early layers barely learn. This vanishing gradient problem is one reason modern networks prefer different activation functions.
The explainer steps through one example with every number shown, so you can check each line with a calculator.