Starting on Fermats Theorem, for $p$ prime, $a>1$ and $mcd(a,p)=1$ $$a^p\equiv a\pmod{p}$$ Then elevating to $p-1$ $$(a^p)^{p-1}\equiv a^{p-1}\pmod{p}\equiv1\pmod{p}$$ Then by elevating to $(p-2)!$ $$(a^{p(p-1)})^{(p-2)!}\equiv1^{(p-2)!}\pmod{p}\equiv1\pmod{p}$$ We arrive to: $$a^{p!}\equiv1\pmod{p}$$ And in general: $$a^{k!}\equiv1\pmod{p}$$ for $k>p-2$
I think its a beautiful result cause it combines number theory and combinatorics, but does it have any application?
Ultimately, as written you're just dressing up the fact $a^{p-1} \equiv 1 \bmod p$ when $(a,p)=1$; I doubt there is any added value in doing so.
There is a related trick that is important: $p-1$ is a composite number, and you can have $(p-1) \mid k!$ for values of $k$ that are much smaller than $p-1$. And if you do, you still have $a^{k!} \equiv 1 \bmod p$.
This is the basis of a simple version of Pollard's $p-1$ algorithm. (in reality, there are better choices for the exponents than factorials, but the algorithm is still often presented using them)