Given the values of a quadratic polynomial, ##ax^2+bx+c##, at three points ##x_0,x_1##, and ##x_2##, which are ##y_0,y_1##, and ##y_2## respectively, you can construct a quadratic polynomial ##p(x)## that matches these values as follows:
\begin{align*}
p(x) = y_0 \frac{x-x_1}{x_0-x_1} \frac{x-x_2}{x_0-x_2} + y_1 \frac{x-x_0}{x_1-x_0} \frac{x-x_2}{x_1-x_2} + y_2 \frac{x-x_0}{x_2-x_0} \frac{x-x_1}{x_2-x_1} \qquad (1)
\end{align*}
This quadratic polynomial ##p(x)## uniquely fits the given values: ##p(x_0)=y_0 , p(x_1) = y_1##, and ##p(x_2)=y_2##. To show its uniqueness, assume there is another quadratic polynomial ##\tilde{p}(x)## that also fits these values. Consider the difference ##q(x)=p(x) - \tilde{p}(x)##. This difference ##q(x)## is a quadratic polynomial:
\begin{align*}
q(x) = p (x) - \tilde{p} (x) = ex^2+fx+g
\end{align*}
which has the three distinct real roots ##x_0,x_1,x_2##. This implies that ##q(x)## is actually the zero polynomial - i.e. ##e=f=g=0##. To understand why, note that as ##q(x)## has three distinct real roots, it would have a shape with both a minimum and a maximum, as illustrated in the graph.
At the minimum and a maximum the derivative ##q' (x)## vanishes. However, the derivative of ##q(x)##, which is ##q'(x) = 2ex + f##, can only have one root. Therefore, it cannot provide the necessary two critical points for ##q(x)## to have both a minimum and a maximum. This contradiction implies that ##q(x)## must be identically zero, and that ##\tilde{p}(x)=p(x)##.
Now let us assume that ##p(x)## has two distinct real roots: ##x_1## and ##x_2##. Then ##y_1=0## and ##y_2=0## and using this in Eq. (1):
\begin{align*}
p(x) = y_0 \frac{x-x_1}{x_0-x_1} \frac{x-x_2}{x_0-x_2} = \frac{y_0}{(x_0-x_1)(x_0-x_2)} (x-x_1)(x-x_2)
\end{align*}
As we have shown that the quadratic polynomial is unique, and we know it is given by ##ax^2+bx+c##, we have ##a=\frac{y_0}{(x_0-x_1)(x_0-x_2)}##, and so:
\begin{align*}
p(x) = a (x-x_1)(x-x_2) .
\end{align*}