The congruence equation $a\equiv b \pmod n \implies \exists k \in \mathbb{Z}, a -b = kn.$
Taking the i-th power of both sides : $(a -b)^i = k^in^i$.
$(a-b)(a-b)^{i-1}=k^in^i$.
$n\mid (a-b), (a-b) \mid (a-b)^i \implies n\mid (a-b)^i \implies \exists m \in \mathbb {Z}, (a-b)^i = mn$.
But, my proof is incomplete, as it does not show still that $a^i - b^i = kn$.
All the comments and answer have ignored the fact that how to get the term $a^i - b^i$ in the first place.
It seems that all have taken the approach to simply take the $a^i- b^i=kn$ as a new equality, not derived from the original one. Just it uses the property of $n \mid (a-b)$ of the original one.