Different definitions of groups being generated by elements Formally, the group generated by some elements subject to some relations is defined to be the quotient of the free group on the corresp. elements modulo the normal subgroup generated by the relations (which are words in the free group).
Another definition of a group being generated by elements is that any element in the group can be written as a (finite) composition of elements from the generating set, their powers and their inverses.
In the case of abelian groups, they can be generated as modules over the integers.
So, above are three seemingly different (at least from the formal point of view) definitions of generators. How are they connected? After asking my previous question I realized I'm confused what definition I should work with.
 A: 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$.
A: A free group $F[S]$ on a set $S$ is a group such that for any other group $G$ and function $S \rightarrow G$ there is a unique group homomorphism $F[S] \rightarrow G$ extending that function.
This gives the connection between your two definitions: given a subset $S \subseteq G$ we can define ourselves a free group $F[S]$ and we get a group homomorphism $F[S] \rightarrow G$ extending the inclusion of $S$ in $G$. This homomorphism is surjective (i.e. your first definition of generating set holds) if and only if $S$ generates $G$ according to your second definition.
