# Definition of orbit of a group

I came across two definitions of orbit:

Definition1: Let $p$ be a permutation of a set $A$ . Let $\sim\subseteq A\times A$ be the relation defined by $$\forall a,b\in A\,\left(a\sim b\iff\exists n\in\mathbb{Z}:\,p^{n}(a)=b\right)$$ This is an equivalence relation (easy to check).
The equivalence classes of this equivalence relation are called the orbits of $p$ in $A$.

Definition2: Let $G$ be a group acting on a set $X$ through an homomorphism $\pi:G\rightarrow S_{X}$. Let $\sim\subseteq X\times X$ be the relation defined by $$\forall a,b\in X\,\left(a\sim b\iff\exists g\in G:\,\pi(g)(a)=b\right)$$ This is an equivalence relation (easy to check).
The equivalence classes of this equivalence relation are called orbits.

I'm not seeing how these can be equivalent, or at least how one can be a particular case of the other. In the second case, the orbits are defined relative to a group, while in the first they are defined relative to an element of a group (the symmetric group)... So: is there a connection? How? Or are these two separate concepts that share the name?

The first definition is the special case of the second where $G$ acting on $A = X$ is the cyclic subgroup of the group $\Sigma_A$ of all permutations of $A$ generated by the permutation $p$.
The first definition is a special case of the second definition. For instance, if $p^n(a)=b$ then take a homomorphism $\pi:\mathbb Z\rightarrow S_X$ where $\pi(n)=p^n$ for the given permutation $p$. Then this induces the same orbits (equivalence classes) as the first case.