The following is a Combinatorial proof of Fermat's Little Theorem from Arthur Engel's book:Problem Solving Strategies.
We have pearls with $a$ colors. From these we make necklaces with exactly $p$ pearls. First, we make a string of pearls. There are $a^p$ different strings. If we throw away the a one-colored strings $a^p − a$ strings will remain. We connect the ends of each string to get necklaces. We find that two strings that differ only by a cyclic permutation of its pearls result in indistinguishable necklaces. But there are $p$ cyclic permutations of p pearls on a string. Hence the number of distinct necklaces is $(a^p − a)/p$. Because of its interpretation this is an integer. So $$p | (a^p − a)$$.
I can't figure out how the primality of $p$ is utilised in this proof. Please Explain.