Perfect divisibility for products in modular arithmetic Say we have that 
$z^2 - x^2 = 0 \ ( \ mod \ p)$
that implies:
$p \ | \  (z-x)(z+x)$
However I was not 100% sure how that implies about the divisibility of p towards $(z-x)$ and/or $(z+x)$ and whether it depends if p is prime or not. The notes I was reading says that "because p is prime, then it divides $(z-x)$ or $(z+x)$". However, say that we have two numbers $n_1$ and $n_2$ and:
$$n_1n_2 = 0 \ ( \ mod \ p)$$ 
and thus:
$$p \ | \ n_1n_2$$
I thought that always implied, regardless of whether p is prime or not, that p either divided $n_1$ or $n_2$. Or am I wrong? Why does p have to be prime? I was suspecting that maybe it had something to do with having multiplicative inverses and $gcd(x,p) = 1$ only being true if p was prime, what I was not sure honestly.
Also, if n is composite, then what do we know if $n \ | \ n_1n_2$? Also, if n is composite, and we know $n \ | \ n_1n_2$, then, does it necessarily mean it must divide either $n_1$ or $n_2$?
I guess I am trying to understand the fundamental reason why p has to be prime for it to divide at least one of them (i.e. what makes p prime special).
Just for reference, this question came from solving the simple quadratic equation I wrote at the top and quadratic residues. 

Primality is sufficient as  $$4\cdot 6|9\cdot8 $$  but $$4\cdot 6\not|9 \text{ or }4\cdot 6\not|8$$
More generally if $p=p_1^2p_2^3$ and $n=p_1^4p_2^5$ where $p_1,p_2$ are primes
Observe that $p$ divides $n$ but  not $p_2^5$ or $p_1^4$
Another point if prime $p>3$ divides both $z+x,z-x$
$p$ will divide $z+x\pm(z-x)\implies p$ will divide $2x$ and $2y$
$\implies p$ will divide $(2x,2y)=2(x,y)$
Hence, $x,y$ must be divisible by $p$
