Cayley's theorem realizes $G$ as a subgroup of $S_n$ when $|G|=n$. There is a more general fact to this.
Suppose that $G$ is a group, and $H$ is a subgroup of $G$ with finite index $n=|G:H|$. Then there is a morphism $\eta:G\to S_n$, and $\ker\eta\leqslant H$ is a normal subgroup of $G$. In particular, $\eta$ is injective if $H$ (or $G$) is simple$^1$, in particular if $H$ is trivial $\eta$ is the usual Cayley representation of $G$ in $S_n$.
$1.$ A group is simple if it admits no nontrivial normal subgroup, that is, the only normal subgroups of $G$ are $1$ and $G$ itself. Examples of simple groups include $A_n$ for $n>4$ and ${\rm PSL}(2,K)$ for every infinite field $K$.
P Let $\{g_1H,\ldots,g_nH\}$ be the distinct left cosets of $H$ in $G$, where the $g_i$ are representatives of each of the cosets. For $g\in G$, $g(g_iH)=(gg_i)H$ is one of the cosets in the tuple, so there is $\sigma(i)$ for which $g(g_iH)=g_{\sigma (i)}H$. Hence each $g\in G$ defines a permutation of these cosets and in turn of $\{1,\ldots,n\}$, that is, we send $g$ to the permutation $\eta(g)$ afforded by $g$. We need to check that $\eta(hg)=\eta(h)\eta(g)$. I will leave this to you. At any rate, we have built a morphism $\eta:G\to S_n$. Now suppose that $g$ is sent to the identity permutation. Then in partulcar, if we choose the coset $H$, we see that $gH=H$, this means that $g\in H$. Hence $\ker \eta\leqslant H$.
This lemma or whatever you want to call it is actually very useful throughout the basic group theory. For example, the above shows that if $G$ is a simple group, then $|G|\leqslant [G:H]!^2$ for any $H\leqslant G$.
$2.$ This is not an literary exclamation mark!$^3$ We're claiming the order of $G$ is at most the order of $[G:H]$ factorial.
$3$. This one is a literary exclamation mark.
In a similar vein, consider the following solution
Every (nonabelian) group of order $216$ is not simple.
P Assume $G$ is simple. By Sylow's theorem $n_3$, the number of Sylow $3$-subgroups, divides $8$ and is congruent to $1$ modulo $3$. This gives that $n_3$ is either $4$ or $1$. Since $G$ is simple, there must be $4$ Sylow subgroups. Then $G$ acts on the set of four Sylow subgroups (by conjugation) and thus gives us a morphism $\eta: G\to S_4$, which is not trivial. Since $\ker \eta$ is a normal subgroup of $G$, it must be the trivial subgroup, hence $G$ injects into $S_4$. But $G$ has order $216$, and $S_4$ has order $4!=24$. This is absurd, so $G$ must have been non-simple, after all.
The general idea is that if we can make $G$ act on a set of $n$ elements, we can obtain a morphism of $G$ into $S_n$. This represents $G$ as a group of permutations, but not necessarily faithfully (i.e. two different elements of $G$ may act identically on our set) since this representation (the morphism) might have a kernel. Cayley's theorem gives a faithful representation, since we're taking the cosets of the trivial subgroup $\{1\}$.