Explanation of Digital Root/ Sum formula The formula to find the digital root/ sum is:
digital root of n = 1 + ( (n - 1) % 9 )

Can someone explain me the intuition behind this formula? Why does this result give the sum of digits?

Numbers in base $10$ are "arranged" into boxes of $10$ entries. For example, $21$ looks like
$$
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\cdot\\
\blacksquare  \square \square \square \square \square \square \square \square \square
$$
and $123$ looks like:
$$
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\cdot\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\blacksquare \blacksquare \blacksquare \blacksquare \blacksquare  \blacksquare \blacksquare \blacksquare \blacksquare \blacksquare\\
\cdot\\
\blacksquare  \blacksquare \blacksquare \square \square \square \square \square \square \square
$$
When you take the modulo $9$, you remove all the "full" packages such as the $100$ and only $1$ remains. (Remove the first $9$ columns, and $10$ boxes remain. $10  \equiv 1\mod 9$). This builds up, so $200$ loses for each $100$ box $99$ boxes, and $2$ boxes remain.
Hope this helps to visualize the operation.
