It is called the division algorithm, but no division actually occurs. Instead we use addition and multiplication to demonstrate what would happen if the division were performed. So there is no explicit division by zero.
Additionally, the polynomial $x - a$ is not the zero polynomial, so even if there were division by $x-a$, it is not division by zero.
Suppose $a$ is a zero of $P(x)$, so $x-a$ is a factor of $P(x)$. That is, $P(x) = (x-a)S(x)$ where $S(x)$ has degree one less than $P$. We have:
\begin{align*}
(x-a)S(x) &= P(x) \\
&= Q(x)(x-a) + R(x) \text{.}
\end{align*}
This is an equality of polynomials, so the value on the left equals the value on the right for each choice of value of $x$. In particular, we may specialize $x$ to the value $a$. (There is still no division actually occurring here. Recall that we define division by "what we would have had to multiply (then add a remainder of bounded degree) to the divisor to obtain the dividend". We are literally following the definition of division to write down this multiplication and addition.) After this specialization of $x$, we obtain
\begin{align*}
(a-a)S(a) &= P(a) \\
&= Q(a)(a-a) + R(a) \text{.}
\end{align*}
Of course, $a-a = 0$ and multiplication by zero is very easy, so this simplifies to
\begin{align*}
0 &= P(a) \\
&= 0 + R(a) \text{.}
\end{align*}
We discover that $P$ is zero at one of its zeroes, $a$, and the remainder, $R(a)$, on dividing $P$ by the linear polynomial corresponding to that zero, $x - a$, is zero at $a$ as well.
But this is not as strong as we want. We want the remainder on dividing by an exact divisor to be the zero polynomial, not just a polynomial that is zero at one place. That is, we want $R(x) = 0$ for all $x$, not just $R(a) = 0$. Let's go back.
\begin{align*}
(x-a)S(x) &= P(x) \\
&= Q(x)(x-a) + R(x) \text{.}
\end{align*}
We require that $R(x)$ has degree less than that of $D(x) = x-a$, which has degree $1$. So $R(x)$ has to have degree at most $0$, so $R(x)$ is constant. We know the value of $R$ at one point: $R(a) = 0$, so $R$ is the constantly zero function, $R(x) = 0$. This is what we wanted to happen.
$x^2$
– Ottavio Dec 29 '20 at 05:29