This is a test for divisibility by 11. Let a natural number $N$ be written in its decimal format as:
$$N = a_n \; a_{n−1} \; a_{n−2} \; \ldots \; a_2 \; a_1 \; a_0$$
where $a$’s are
the digits of the number.
Let
$$T = a_0 − a_1 + a_2 − a_3 + \ldots + (−1)^n a_n$$
Show that 11 divides $N$ $\iff$ 11 divides $T$.
Let's write $N$ as the sum
$$ N = 10^n a_n + 10^{n-1}a_{n-1} + 10^{n-2}a_{n-2} + \ldots 10^2a_2 + 10^1a_1 + 10^0a_0$$
Since $10 \equiv -1 \pmod {11}$, we can write
$$\begin{align} N & \equiv (-1)^n a_n + (-1)^{n-1}a_{n-1} + (-1)^{n-2}a_{n-2} + \ldots (-1)^2a_2 + (-1)^1a_1 + (-1)^0a_0 \pmod {11} \\ \\ & \equiv a_0 - a_1 + a_2 - a_3 + \ldots + (-1)^n a_n \\ \\ & \equiv T \pmod {11}\end{align}$$
($\implies$) If 11 divides $N$ then $N \equiv 0 \pmod{11}$. The above tells us $T \equiv 0 \pmod{11}$, and so 11 divides $T$.
($\impliedby$) If 11 divides $T$ then $T \equiv 0 \pmod{11}$. The above tells us $N \equiv 0 \pmod{11}$, and so 11 divides $N$.