The intuition here is that we have a surjection $f:X\to Y$ and we want to upgrade it to an injection by somehow modifying the domain $X$ into a new domain $\tilde{X}$ and procuring a better version, call it $\tilde{f}$, of $f$ from this new domain to $Y$.

A simple example is given by the map $f:\{1,2,3,4,5,6\}\to\{1,2,3\}$ defined by
$$f(1)=1\\
f(2)=2\\
f(3)=2\\
f(4)=1\\
f(5)=3\\
f(6)=1$$

Our toy function $f$ fails to be injective because it sends $1$, $4$, and $6$ all to $1$, and $2$ and $3$ both to $2$.
One way to "injectify" $f$ would be to pick a *subset* of the domain, like $\tilde{X} = \{1,2,5\}$, and let $\tilde{f}$ be the restriction of $f$ to $\tilde{X}$.
Sure, $\tilde{f}$ is now injective,
but why did we pick the set $\{1,2,5\}$?
Why not, say, $\{3,4,5\}$ or $\{3,5,6\}$?
None of these choices is *natural*.

We remedy this by *bunching together* all the points where $f$ fails to be injective. Define a new domain $\tilde{X} = \{\{1,4,6\}, \{2,3\}, \{5\}\}$ whose elements are *sets* of numbers, as opposed to just numbers. (This shouldn't be an intuitive obstacle, because, at the end of the day, *everything* is a set.) Note, in particular, that $5$ gets put in a box all by itself, and appears within $\tilde{X}$ as $\{5\}$, not as $5$. This is so that the elements of $\tilde{X}$ have a guaranteed uniform type: they are subsets of $X$, not a mixture of subsets and elements of $X$.

How should we define $\tilde{f}$ on $\tilde{X}$? Let's go step by step.
Where should $\tilde{f}$ send $\{1,4,6\}$?
The obvious choice is $1$, because $1$ is equal to $f(1)$ and to $f(4)$ and to $f(6)$. The set $\{1,4,6\}$ was defined entirely in terms of $f$ (indeed, $\{1,4,6\}$ is precisely the preimage of $1$ under $f$)
so it's most natural to define $\tilde{f}(\{1,4,6\})$ also entirely in terms of $f$.
Making similar definitions for $\{2,3\}$ and $\{5\}$,
we see that the map $\tilde{f}:\tilde{X}\to Y$ looks like this:
$$\tilde{f}(\{1,4,6\}) = 1\\
\tilde{f}(\{2,3\}) = 2\\
\tilde{f}(\{5\}) = 3$$
We win! $\tilde{f}$ is injective, and surjective, hence bijective.

So what did we do, really?
A typical element of $\tilde{X}$ is a biggest-possible
set of points of $X$ that $f$ cannot tell apart.
Your equivalence relation is $x\sim x'$ iff $f(x) = f(x')$.
Personally, I call this "equality in the eyes of $f$",
and it is a *very* common source of equivalence relations.
The relation itself as a subset of $X\times X$ is called the *kernel* of $f$; you can read about that here: http://en.wikipedia.org/wiki/Kernel_%28set_theory%29. Note that my $\tilde{X}$ is equal to your $X/R$.

Finally, a note on the projection map $\pi$. In our toy example,
there is a pretty obvious map from $\{1,2,3,4,5,6\}$ to $\{\{1,4,6\},\{2,3\},\{5\}\}$: send a number to the box containing it.
That's all that $\pi$ is doing.

Armed with this intuition, I hope you can work out the details of the general case!