How does this Turing machine accept $a^n b^n$?
The machine just changes the $O$ to $A$ and the $1$ to $B$, in such a
way that it changes a $1$ each time it has changes a $0$. Hence, if
there is the same number of $0$ and $1$, they all end up being changed
at some point. The TM no longer finding any $0$ will go to the bottom
part of the diagram and check that all $1$ have been changed to $B$,
i.e. that the sequence of $B$ is followed by a blank space. In that
case it accepts.

But is some $1$ is left after the $B$, then the TM will block in state
$q_3$ (no transition corresponding to $1$ on the tape) and
reject. Indeed, that means hat there were more $1$ than $0$, which
does not conform.

But if there were more $0$ than $1$, say $0^n1^m$ with $n&gt;m$, the TM
will block in state $q_1$.  The reason is that, after erasing $m$
symbols $0$ and correspondingly $m$ symbols $1$, the TM will erase
another $0$, and try in state $q_1$ to find another $1$ to erase. But
it will find none, only a blank space.