The way telescoping works is really simple. As an example I will show you how one can derive the formula to calculate the sum of the first $n$ terms of a geometric series.
We want to find $S_n = 1 + x + x^2 + x^3 + \cdots + x^n$
We first compute $xS_n = x + x^2 + x^3 + \cdots + x^n + x^{n+1}$
And now we calculate $xS_n - S_n$:
$$\begin{align*} xS_n - S_n =\ &\color{red}{x + x^2 + x^3 + \cdots + x^n} + x^{n+1}\\
- (1 +&\color{red}{ x + x^2 + x^3 + \cdots + x^n})
\end{align*} \iff\\
S_n(x - 1) = - 1 - x^{n+1}\\
S_n = \frac{-1-x^{n+1}}{x - 1} = \frac{1 + x^{n+1}}{1 - x}$$
The telescoping bit was when the factors in red canceled out.
We can apply a similar technique for $(x^n - y^n)$. Motivated by the fact that $(x^2 - y^2) = (x - y)(x + y)$ we may try to write $(x^n - y^n)$ as $(x - y)(\text{some factors here})$. The easiest factors to guess are the $x^{n-1}$ and $y^{n-1}$ that will not be cancelled out. Let us call $P$ the part that gets factored out to which we will apply the telescoping method. We already now $P = x^{n-1} + a_2 + \cdots + a_k + y^{n-1}$ and our aim is to have $(x - y)P = (x^n - y^n)$,
$$\begin{align*} (x - y)P = xP - yP =\\
x(x^{n-1} + a_2 + a_3 + \cdots + a_k &+ y^{n-1})\\
- (y(x^{n-1} + a_2 + a_3 + \cdots &+ a_k + y^{n-1}))\iff\\
(x^{n} + xa_2 + xa_3 + \cdots + xa_k &+ xy^{n-1})\\
- (yx^{n-1} + ya_2 + ya_3 + \cdots &+ ya_k + y^{n})
\end{align*}$$
And you get that
$$\begin{cases} xa_2 = yx^{n-1}\\
ya_i = xa_{i+1}\\
ya_k = y^{n-1}x
\end{cases}$$
Using the second equation, you can write $a_{i+1} = \frac{y}{x}a_i$ and using the first case you can get that $a_2 = yx^{n-2}$ and then we can get, by the third case, $a_k = y^{n-2}x$. Each iteration your exponent on $y$ increases by 1 and your $x$ exponent decreases by 1 so we can see that $k = n-2$ and rewrite $a_i = y^{i-1}x^{n-i}$ like that. Thus we have
$$P = \sum_{i=1}^{n} a_i = \sum_{i=1}^{n} y^{i-1}x^{n-i}$$
and we should note that this, for $i = 1$ and $i = n$ goes with our initial guesses. One can now show that $(x - y)P = (x^n - y^n)$:
$$(x - y)P = (x - y)\sum_{i=1}^{n} y^{i-1}x^{n-i} = x\sum_{i=1}^{n} y^{i-1}x^{n-i} - y\sum_{i=1}^{n} y^{i-1}x^{n-i} =\\
= \sum_{i=1}^{n} y^{i-1}x^{n-i+1} - \sum_{i=1}^{n} y^{i}x^{n-i}$$
Now with a careful manipulation of the first summation's limits we can use the telescoping method! We rewrite
$$\sum_{i=1}^{n} y^{i-1}x^{n-i+1} = \sum_{i=1}^{n} y^{i-1}x^{n-(i-1)} = \sum_{i=0}^{n-1} y^{i}x^{n-i}$$
And putting everything together yields
$$(x-y)P = \sum_{i=0}^{n-1} y^{i}x^{n-i} - \sum_{i=1}^{n} y^{i}x^{n-i} = x^n - y^n$$ because all terms cancel one-to-one except the first of the first summation and the last of the last summation.