When $G$ is a group and $S\subseteq G$ a subset, the usual definition of the subgroup of $G$ generated by $S$ is the intersection of all subgroups of $G$ containing $S$ and is denoted by $\langle S\rangle$. From this definition it is easy to show that $\langle S\rangle$ consists of all elements of $G$ that can be written as finite products of the elements of $S$ and their inverses.
When $G=\langle S\rangle$, we say that $G$ is generated by the elements of $S$. In this case, you may write down all elements of $G$ as finite words
$$
s_1^{\epsilon_1} s_2^{\epsilon_2} \cdots s_n^{\epsilon_n}
\qquad
\text{with }n\in\mathbb N, s_i\in S, \epsilon_i\in\{+1,-1\}.
$$
However, different words might describe the same element of $G$, that is: there might be relations between the generators. For example, in any abelian group you will have $s_1 s_2=s_2 s_1$. Hence, if you want to capture the structure a of group by a given generating set, you also have to keep track of these relations. To do this, you first define the free group $F(X)$ on an arbitrary set $X$. It it the set of all equivalence classes of finite words over the alphabet consisting of the symbols $x$ and $x^{-1}$ for all $x\in X$ subject to the equivalence relation that identifies words $w$ and $w'$ when $w'$ is obtained from $w$ by adding or removing finitely many subwords of the form $xx^{-1}$ or $x^{-1}x$. For the group $F(X)$ we certainly have $F(X)=\langle X\rangle$ by definition. Furthermore, there are no relations between the generators other than those necessary for $F(X)$ to be a group.
Now when $G=\langle S\rangle$ is any group generated by a subset $S\subseteq G$, the above construction yields that there is exactly one group homomorphism $\gamma\colon F(S)\to G$ with $\gamma(s)=s$ for all $s\in S$. The homomorphism theorem yields that $\overline\gamma\colon F(S)/\ker(\gamma) \to G$ is an isomorphism. Hence, to capture the structure of $G$, you have to know a generating set $S$ and the corresponding kernel $\ker(\gamma)$. Since $\ker(\gamma)$ is a group itself, you might find a (smaller) set $R\subseteq F(S)$ such that $\ker(\gamma)=\langle R\rangle$ is the subgroup of $F(S)$ generated by $R$. Then $G\cong F(S)/\langle R\rangle$ and we call this a presentation of G by generators and relations and just write $\langle S\,|\,R\rangle$ instead of $F(S)/\langle R\rangle$. Since $S$ was a subset of $G$ to begin with, we usually identify $G=\langle S\,|\,R\rangle$, while formally the groups are set theoretically different.
Since $\ker(\gamma)$ is always a normal subgroup we might find an (even smaller) subset $R'\subseteq F(S)$ such that $\ker(\gamma)=\langle\langle R'\rangle\rangle$ is the normal subgroup generated by $R'$. Here $\langle\langle R'\rangle\rangle$ is the intersection of just the normal subgroups of $F(S)$ containing $R'$, or equivalently the subgroup generated by all conjugates of elements of $R'$ with elements of $F(S)$, that is, the generators are of the form $srs^{-1}$ with $r\in R'$ and $s\in F(S)$. In this case we still write $\langle S\,|\,R'\rangle$ for $F(S)/\langle\langle R'\rangle\rangle$.