Wilson's Theorem: (n-1)! is congruent to -1(mod n) implies that n is prime. I have researched Wilson's theorem several times over stack exchange. I would only like to prove one direction. This seems to be a good explanation: Prove that $(n-1)! \equiv -1 \pmod{n}$ iff $n$ is prime
However, on their explanation, the author states that $k|(n-1)!$ implies that $k$ is congruent to $1$(mod $n$). I don't see their jump in logic. I am looking for either an explanation or a reference to a theorem if possible. Any assistance is appreciated. Thank you

As mentioned previously, the implication as you interpreted it is incorrect.  $k\mid (n-1)!$ does not imply that $k\equiv 1\pmod{n}$.  Take any counterexample you like, such as $k=3,n=5$.
Here I hope to go over some of the details of that section of the proof in the attempt to clarify some of the points.
Suppose that $(n-1)!\equiv -1\pmod{n}$
We argue that $n$ must be prime.  To accomplish this, suppose to the contrary that $n$ is in fact composite.  In this case, $n=km$ for some $k,m\in\mathbb{N}\setminus\{1\}$ implying that $k<n$.
In this case, $k$ must then be equal to one of $\{2,3,4,\dots,n-2,n-1\}$.  This implies that $k\mid (n-1)!$ since $(n-1)!=\prod\limits_{i=1}^{n-1} i = k\prod\limits_{i=1~~~i\neq k}^{n-1} i$.
However, since $(n-1)!\equiv -1\pmod{n}$ and $k\mid n$ and $k\mid (n-1)!$, all of these things together imply that $k\equiv 1\pmod{n}$
Why?  Since $k\mid n$ and $k\mid (n-1)!$, you have that $k\mid \gcd((n-1)!,n)$, but since $(n-1)!\equiv -1\pmod{n}$ that implies that $(n-1)!$ is coprime to $n$ (since this implies there is some multiple of $n$ which is exactly one away from $(n-1)!$).  Therefore $\gcd((n-1)!,n)=1$ and so $k\mid 1$.  This is, however, a contradiction since we said that $k\in\mathbb{N}\setminus \{1\}$.
