I've recently been introduced to calculus and ran into a rational function that seems to be somewhat complicated for my understanding, which is shown in the form:

$f(x)=\frac{(x-a)(x-b)}{(c-a)(c-b)}\cdot a+\frac{(x-b)(x-c)}{(a-b)(a-c)}\cdot b+\frac{(x-a)(x-c)}{(b-a)(b-c)}\cdot c$

Bearing in mind that when f(a)=b, f(b)=c and f(c)=a due to substitution.

However, the part I don't understand is the simplification of the equation into the quadratic form as follows:

$\frac{1}{(a-b)(a-c)(b-c)}[(a-b)a+(b-c)b+(c-a)c]{x}^{2}+[(a-b){b}^{2}+(b-c){c}^{2}+(c-a){a}^{2}]x+[(a-b){a}^{2}+(b-c){b}^{2}c+(c-a)a{c}^{2}]$

Based on my algebraic knowledge, I know that the factorization formula is ${x}^{2}+(a+b)x+ab$

My question is how did the coefficients and rearranged dominator of the original equation come about? Can anyone detail it for me, please?