Let \(p\) be a prime. Using the binomial theorem, we use expand \((x + y)^p\):
$$ (x+y)^p=\sum^p_{k=0}\binom{p}{k}x^{k}y^{p-k} $$
If we take out the first and last term:
$$ (x+y)^p= x^p + y^p + \sum^{p-1}_{k=1}\binom{p}{k}x^{k}y^{p-k} $$
There is a factor of \(p\) inside \(\binom{p}{k}\), which means:
$$ \sum^{p-1}_{k=1}\binom{p}{k}x^{k}y^{p-k} ≡ 0 \mod p $$
This would also mean:
$$ (x+y)^p = x^p + y^p \mod p $$