What exactly does the relation over the set $X$ mean concerning orbits? My book says this:

Suppose that $G$ is a group of permutations of a set $X$. We shall show that the group structure of $G$ leads naturally to a partition of $X$.
Define a relation $\sim$ on $X$ by the rule
$$ x \sim y \iff g(x) = y \text{ for some } g \in G $$

Lets say that $X$ is the set $\{ 1, 2, 3 \}$, then a group of permutations of $X$ could be $\{ (1)(2)(3), (123), (132) \} = H$.
As I've understood it, group elements act on group elements. For example, $(123) \cdot (132) = (1)(2)(3) \in H$.
But what does $g(x) \mid g ∈ G$ mean? I assume $x, y \in X$ which would be either $1$, $2$ or $3$ in the example, but $g$ doesn't have the binary operation defined over elements of $X$?
I'm sorry if this is very basic :( 
 A: In this context, I assume, you have come across the group actions. I shall write about the notion of orbits here, along the same lines of your definition:

Firstly, let me clarify, that, $g(x)|g \in G,x \in X$ stands for the following: Since $G$ is a group of permutations, we interpret the elements of $G$ as bijections of $G$ onto $G$. This in particular means $g$ is a function and takes values in $X$. So, $g(x)$ is another element in $X$.
For instance, if, $g=(123)$, then, $g(1)=2;~g(2)=3;~g(3)=1$.

Now let's talk about these orbits!
Define a relation $\sim$ on $X$, $x \sim y \iff \exists~~g \in G ~~~\text{s.t}~~ g(x)=y$.
Now I claim that this is an equivalence relation:

*

*It is reflexive. Since, $G$ is a group, the identity element exists in $G$ and takes any element to itself.


*It is transitive. Suppose $g(x)=y$ and $h(y)=z$, then $h \circ g(x)=y$ and note that $h \circ g$ is a well-defined member of $G$.


*It is Symmetric. Suppose $g(x)=y$. Then, $g^{-1}(y)=x$, and yet again, thanks to the group structure on $G$. We have that, inverses exist for elements in $G$ (and, infact they are unique!)
Now, an equivalence relation partitions the set into disjoint sets, called equivalence classes. (Prove this, if you are not aware of it!)
So, "your claim that group structure on $G$ partitions $X$ quite naturally" is justified!
Hope this helps!
