What is the logic behind this particular expression?
$$ \frac {x(10^x-1)}{9} $$
Basically, if one puts any number $x$ into the expression above, you get the number $x$, repeated $x$ times. Case in point: 5 would be 55555, etc.
Why does this work the way it does? Is it possible to simplify this at all and get the same result?
What you originally wrote, $x \cdot \frac{10^{x-1}}{9}$, doesn't work. For example for $x = 5$ you get $$ 5 \cdot \frac{10^4}{9} = 5555.555555555\ldots $$ which isn't even an integer.
The correct equation (which is now updated in the OP) is $$ x \cdot \frac{10^{x} - 1}{9} \tag{1} $$ Plugging in $x = 5$ we get $55555$, which is what you want. This also works for anything from $x = 1$ to $x = 9$, but it doesn't work for numbers larger with more than one digit. For example, if we plug in $12$ we get $$ 12 \cdot \frac{10^{12} - 1}{9} = 1\,333\,333\,333\,332. $$
How does it work?
The ${10^x - 1}$ gives you a list of $x$ 9's: for example, $10^5 - 1$ is one less than $100000$, which is $99999$, $5$ 9's. Then dividing by $9$, we get a list of $x$ 1's: $\frac{99999}{9} = 11111$ if $x = 5$. Finally, multiplying by $x$ (if $x$ is only a single digit) we get a list of $x$ $x$'s.