Insight

We may rearrange our result $$f(x) = \frac{x_1y_0 - x_0y_1}{x_1 -x_0} + \frac{y_1 -y_0}{x_1 -x_0} x$$
to obtain $$f(x) = \color{var(--emphColor)}{y_0}\frac{x-x_1}{x_0-x_1}+ \color{var(--emphColor)}{y_1}\frac{x -x_0}{x_1- x_0}.$$
$$f(x) = \color{var(--emphColor)}{y_0}\frac{x-x_1}{x_0-x_1}+ \color{var(--emphColor)}{y_1}\frac{x -x_0}{x_1- x_0}$$
We've obtained $f$ as a linear combination of two degree $1$ polynomials, $$L_0(x) = \frac{x-x_1}{x_0-x_1}, \text{ and } L_1(x) = \frac{x -x_0}{x_1- x_0}.$$
What are $L_0(x_0)$ and $L_0(x_1)$? What about $L_1(x_0)$ and $L_1(x_1)$?

What if?

Suppose we had at our disposal $n+1$ polynomials $L_{j}(x)$ degree $n$ such that $$L_\color{var(--emphColor)}{j}(x_\color{var(--emphColor)}{i}) = \begin{cases} 1, &\text{if } \color{var(--emphColor)}{i} = \color{var(--emphColor)}{j}\\ 0, & \text{ otherwise.} \end{cases}$$
Then we could immediately obtain the interpolant!

Lagrange interpolation

If $L_\color{var(--emphColor)}{j}(x_\color{var(--emphColor)}{i}) = \delta_{ij}$ then $$f(x) = \sum_{j=0}^n y_j L_j(x)$$ interpolates the data $(x_0, y_0), \ldots, (x_n, y_n).$
As usual, $\delta_{ij}$ denotes the Kronecker delta.
Why does $f$ interpolate the data?

Lagrange interpolation

$$f(x) = \sum_{j=0}^n y_j L_j(x)$$

Lagrange interpolation

$$f(x) = \sum_{j=0}^n y_j L_j(x)$$

Lagrange interpolation

$$f(x) = \sum_{j=0}^n y_j L_j(x)$$
Are these $L_j$ really out there? If so, what do they look like?
The $n$ nodes $x_0, \ldots, x_{j-1}, x_{j+1}, \ldots, x_n$ must be roots of $L_j,$ and the degree of $L_j$ is at most $n$, so $$L_\color{var(--emphColor)}{j}(x) = c(x - x_0)\cdots(x - x_{\color{var(--emphColor)}{j-1}})(x-x_{\color{var(--emphColor)}{j+1}})\cdots(x-x_n)$$ for some constant $c$.
The requirement $L_\color{var(--emphColor)}{j}(x_\color{var(--emphColor)}{j}) = 1$ implies that $$c = {1 \over (x_\color{var(--emphColor)}{j} - x_0)\cdots(x_\color{var(--emphColor)}{j} - x_{j-1})(x_\color{var(--emphColor)}{j}-x_{j+1})\cdots(x_j-x_n)}.$$
Combining results, we obtain $$L_j(x) = \prod_{k \neq j \\ k = 0}^n{x - x_k \over x_j - x_k}.$$
The polynomials $L_j$ really do exist! We call $L_j$ the $j$th degree $n$ Lagrange basis polynomial.
Much like we use Sigma to denote a sum, $$\sum_{k=0}^n a_k = a_0 + a_1 + \cdots + a_n,$$ we use Pi to denote a product, $$\prod_{k=0}^n a_k = a_0 \cdot a_1 \cdot \cdots \cdot a_n.$$