Given some expression of $a \in \mathbb{Z}$, say $P(a)$, are the following 2 statements equivalent?
$n$ divides $P(a), \, \forall a \in \mathbb{Z}$ and for some fixed $n \in \mathbb{N}$
$P(a) \bmod n = 0, \forall a \in \{0,1, \ldots, n-1\}$
Yes, let's derive the equivalence step-by-step.
$$\begin{align}
\forall\, a\,\in\, \Bbb Z:&\ \ \ n\,\mid\, P(a)\\[.2em]
\iff \forall\, a\,\in\, \Bbb Z:&\ \ \ 0 = P(a)\bmod n\\[.2em]
\iff \forall\, a\,\in\, \Bbb Z:&\ \ \ 0 = P(\bar a)\bmod n,\,\ \bar a = a\bmod n, \ \rm by\ \color{#C00}{PCR}\\[.2em]
\iff \forall\, \bar a\in[n]\!:&\ \ \ 0 = P(\bar a)\bmod n,\,\ [n] = \{0,1,\ldots,n\!-\!1\}\\[.2em]
\iff \forall\, \bar a\in\Bbb Z_n\!:&\ \ \ 0 = P(\bar a)
\end{align}\qquad$$
where we employed the following Polynomial Congruence Rule $\, =\rm\color{#C00}{PCR}$
$\quad \bmod n\!:\ a\equiv \bar a\,\Rightarrow\, P(a)\equiv P(\bar a),\ $ for $\,P(x)\,$ any polynomial with integer coef's
Generally, given any expression composed of sums and products of integers, its value $\bmod n\,$ is unchanged when we replace the arguments of the sums and products by congruent arguments. In particular this is true if we replace them by their least nonnegative reps $\, a\mapsto a\bmod n$.
Above we could replace the standard residue system $\,[n] = 0,1,2,\ldots\,n\!-\!1\,$ by any complete system of residues $\cal R,\,$ i.e. any set of integers such that every integer is congruent to exactly one $\,r\in \cal R.\,$ Then verifying that every $\,r\in\cal R\,$ is a root is sufficient to guarantee that every integer is a root, since every integer is congruent to some normal rep $\,r\in\cal R,\,$ i.e. we have $\,n\equiv r\in {\cal R}\,\Rightarrow\, P(n)\equiv P(r)\equiv 0,\,$ by $\,\rm\color{#c00}{PCR}$
A "normal" rep in $\cal R$ can be view as "name' or "label" for the entire set of integers equivalent to it, i.e. $\,r\mapsto [r]_n = r + n\Bbb Z,\,$ the set of all integers $\equiv r\pmod{\!n}.\,$ Then the congruence sum and product rules imply that addition and multiplication is well-defined on these classes by the rules $[a]+[b] = [a+b],\,$ $[a]*[b] = [a*b].\,$ In turn this implies that the arithmetical (ring) laws of $\,\Bbb Z\,$ are inherited by the classes with these operations, so they form a new system of numbers (ring) $\,\Bbb Z_n\,$ sharing many of the same properties of the ring of integers - so we can reuse our well-honed integer arithmetic intuition in this new modular number system. In particular, viewed in the ring $\,\Bbb Z_n\,$ your statement simplifies to the final form in the string of equivalences, viz. $\,\forall\,\bar a \in \Bbb Z_n\!:\ P(\bar a) = 0,\,$ i.e. every element of $\,\Bbb Z_n\,$ is a root of $\,P\,$ (here $P$ is viewed as a polynomial over $\,\Bbb Z_n\,$ by mapping its integer coef's into $\,\Bbb Z_n\,$ via $\,p_i\mapsto \bar p_i = [p_i]_n)$.