I saw this observation in a math book once when I was 16 or so and was totally baffled at the time. It's nice to know I understand it now!

As you say, the starting point is to use CRT, which allows us to write $\mathbb{Z}_{10} \cong \mathbb{Z}_2 \times \mathbb{Z}_5$, so we can work in the $2$-adics and $5$-adics separately. It's easy to understand what happens to the powers of $5$ in $\mathbb{Z}_5$: they converge to zero. Similarly for the powers of $2$ in $\mathbb{Z}_2$. The tricky question is about the powers of $5$ in $\mathbb{Z}_2$ and the powers of $2$ in $\mathbb{Z}_5$.

Here, as you also say, the starting point is that by Fermat's little theorem we have $x^p \equiv x \bmod p$. So at least the first digit $\bmod p$ stabilizes. What can we say about taking further iterations $\bmod p^2, p^3$, etc.?

**Theorem (existence of the Teichmuller character):** Let $p$ be a prime and let $x \in \mathbb{Z}_p$. The sequence $x, x^p, x^{p^2}, \dots$ converges and its limit $\omega(x)$, the *Teichmuller character* of $x$, is the unique solution to $\omega(x)^p = \omega(x)$ which is congruent to $x \bmod p$.

*Proof.* This sequence always lies in the subspace $S_x$ of $\mathbb{Z}_p$ consisting of elements congruent to $x \bmod p$. It suffices to show that on this subspace, the Frobenius map $F(x) = x^p$ is a contraction in the $p$-adic metric so we can apply the Banach fixed point theorem. In other words, we want to show that there exists some constant $c < 1$ such that for all $a, b \in S_x$ we have

$$|a^p - b^p|_p \le c |a - b|_p.$$

This follows from a contest math result called lifting the exponent although we won't need its full strength so we can settle for only part of the proof. Since by assumption $a \equiv b \bmod p$, we can argue as follows: write

$$\frac{a^p - b^p}{a - b} = a^{p-1} + a^{p-2} b + \dots + b^{p-1}.$$

This sequence has $p$ terms and each term is congruent to $a^{p-1} \equiv b^{p-1} \bmod p$, so their sum is congruent to $0 \bmod p$. So $a^p - b^p$ is divisible by at least one more power of $p$ than $a - b$ is, which means the Frobenius map is a contraction with $c = p^{-1}$.

Applying the Banach fixed point theorem we conclude that the sequence $x, F(x), F^2(x), \dots $ converges to a *unique* fixed point $\omega(x)$ in $S_x$: this means precisely that $\omega(x) \equiv x \bmod p$ and $\omega(x)^p = \omega(x)$ and that $\omega(x)$ is unique with respect to these two properties. (Alternatively this existence and uniqueness result can also be deduced from Hensel's lemma.) $\Box$

This means that the Teichmuller character provides a *canonical* splitting of the map $\mathbb{Z}_p^{\times} \to \mathbb{F}_p^{\times}$ on groups of units, allowing us to construct the $(p-1)^{th}$ roots of unity in $\mathbb{Z}_p$ surprisingly explicitly.

Applying the theorem, we get:

- The sequence $5, 5^2, 5^4, \dots $ converges in $\mathbb{Z}_2$ to the unique solution to $\omega(5)^2 = \omega(5)$ congruent to $1 \bmod 2$, which is $1$. In other words, the sequence converges in $\mathbb{Z}_{10} \cong \mathbb{Z}_2 \times \mathbb{Z}_5$ to $(1, 0)$, which is precisely the idempotent projecting from $\mathbb{Z}_{10}$ down to $\mathbb{Z}_2$.
- The sequence $2, 2^5, 2^{25}, \dots$ converges in $\mathbb{Z}_5$ to the unique solution to $\omega(2)^5 = \omega(2)$ congruent to $2 \bmod 5$, which is one of the two primitive $4^{th}$ roots of unity. In other words, the sequence converges in $\mathbb{Z}_{10} \cong \mathbb{Z}_2 \times \mathbb{Z}_5$ to an element you might call $(0, i)$.

Now we of course have $(1, 0) \cdot (0, i) = (0, 0)$. The fun part is that if we take the fourth power of $(0, i)$, getting the limit of the sequence $16, 16^5, \dots$, we get $(0, 1)$, which is the idempotent projecting from $\mathbb{Z}_{10}$ down to $\mathbb{Z}_5$, and it satisfies $(0, 1)^2 = (0, 1)$ and $(0, 1) + (1, 0) = (1, 1)$; in other words, if we know the digits of $(1, 0) = \dots 90625$ we can compute the digits of $(0, 1)$ by just subtracting from $1$, which gives

$$\lim_{n \to \infty} 16^{5^n} = \dots 09376 = 1 - \lim_{n \to \infty} 5^{2^n}$$

and you can check this on a calculator!

What this says in other words is that these two limits, which somewhat abusing notation I'll call $\omega(5)$ and $\omega(16)$, give a canonical decomposition of any $10$-adic number into two components

$$x = \omega(5) x + \omega(16) x$$

where the first component is $5$-adically zero and gives the $2$-adic component of $x$ and the second component is $2$-adically zero and gives the $5$-adic component of $x$.

(You may be familiar with a certain explicit proof of CRT that constructs idempotents like these to show, for example, that $5x + 6y$ is an explicit number congruent to $x \bmod 2$ and $y \bmod 5$; this construction gives a compatible family of such idempotents $\bmod 10^n$ for all $n$.)