Leader election solves "who is in charge"; fencing tokens solve "how do we know the old leader is really out." This diagram runs the full sequence: candidates contend for a lock, one wins with a lease, renews it, fails, and a successor takes over — then the original wakes up and tries to write. The fencing token is the detail that makes the story safe. When the successor acquires the lock, it receives a strictly greater token, and the shared resource checks every write's token against the current one.
Without fencing, failover is a guess. The old leader may simply have been partitioned or paused — it still believes it holds the lease, and its writes arrive after the new leader's, corrupting the shared state. With fencing, the resource itself enforces single-writer semantics: the stale leader's token is lower, so its writes are rejected. The stages are ordered by trust — lease expiry, token increment, then fencing — and the ordering is exactly what rules out split-brain.