Let $p$ be an odd prime. We give a pairing argument for the result.
Let $1\le x\le p-1$ and $1\le y\le p-1$. Call $x$ and $y$ friends if $xy\equiv a\pmod{p}$ and $x\ne y$. Note that any $y$ has at most one friend. This is because for any $y$ there is a unique $x$ such that $xy\equiv a\pmod{p}$. So $y$ is friendless precisely if that unique $x$ is congruent to $y$, that is, if $y^2\equiv a\pmod{p}$.
Thus if $a$ is a quadratic non-residue of $p$, then every $y$ has a friend, and therefore the numbers from $1$ to $p-1$ can be paired so that any pair has product congruent to $a$. It follows that $(p-1)!\equiv a^{(p-1)/2} \pmod{p}$, and therefore $a^{(p-1)/2}\equiv -1\pmod{p}$ by Wilson's Theorem.
If $a$ is a quadratic residue of $p$, then the two solutions of $x^2\equiv a\pmod{p}$ are friendless. If one of them is $r$, the other is congruent to $-r$ modulo $p$, so their product is congruent to $-a^2$ modulo $p$. Also, there are $(p-3)/2$ pairs of friends. It follows that
$$(p-1)! \equiv a^{(p-3)/2}(-a^2)\equiv -a^{(p-1)/2}\pmod{p}.$$
So again from Wilson's Theorem we have $a^{(p-1)/2}\equiv 1\pmod{p}$.