My interpretation of the given answer:
We see that $222222$ is divisible by $13$. There's two tools in use here:
$$222222[\text{some digits}] \equiv [\text{some digits}] \pmod {13}$$
and
$$[\text{some digits}]222222$$ is divisible by $13$ if and only if $$[\text{some digits}]$$ is divisible by $13$.
This means, in order to determine divisibility by $13$, we can eliminate $2$'s in groups of six from the start and the end of the number.
We can eliminate $42=6 \times 7$ most significant $2$'s and $36=6 \times 6$ least significant $2$'s, which leaves the original number being divisible by $13$ if and only if the number $2a$ is divisible by $13$ (here $2a$ is a $2$-digit number written in decimals, i.e., $=20+a$).
Then we just check which number of the form $2a$ is divisible by $13$, and it happens to be $26$. So $a=6$.