Surjective Group Homomorphism From Braid Group Into Symmetric Group I am reading this article on wikipedia. Here's the relevant excerpt:

By forgetting how the strands twist and cross, every braid on $n$ strands determines a permutation on $n$ elements. This assignment is onto, compatible with composition, and therefore becomes a surjective group homomorphism $B_n \to S_n$ from the braid group into the symmetric group. The image of the braid $\sigma_i \in B_n$ is the transposition $s_i = \left(i, i+1\right) \in S_n$. These transpositions generate the symmetric group, satisfy the braid group relations, and have order $2$. This transforms the Artin presentation of the braid group into the Coxeter presentation of the symmetric group:
  $S_n = \left \langle s_1,\ldots,s_{n-1}| s_i s_{i+1} s_i=s_{i+1} s_i s_{i+1}, s_i s_j = s_j s_i \text{ for } |i-j|\geq 2, s_i^2=1 \right\rangle.$

I am confused by how the second sentence comes out with the conclusion that this assignment is a group homomorphism. I understand why it is surjective, but why homomorphism? Does compatibility with composition imply homomorphism? 
My second question: Referring to the third sentence, how does making the image of the braid $\sigma_{i} \in  B_{n}$ be the transposition $s_{i} = (i, i+1) \in S_{n}$ helps in proving that the mapping from $B_{n}$ to $S_{n}$ is a surjective group homomorphism? 
Any help is appreciated. Thanks.

It's important to understand the concept of presentation of a group. This is also mentioned in the Wikipedia article cited in your question. This article gives the following presentation for the braid group $B_n.$
$
B_n = \left< \sigma_1,\ldots,\sigma_{n-1} | \sigma_i\sigma_{i+1}\sigma_i = \sigma_{i+1}\sigma_i\sigma_{i+1}\ for\ 1\leq i \leq n - 2\
and\ \sigma_i\sigma_j = \sigma_j\sigma_i\ for\ |i-j| > 1\right>
$
It also gives the following presentation for the symmetric group $S_n.$
$
S_n = \left< s_1,\ldots,s_{n-1} | s_i s_{i+1} s_i = s_{i+1} s_i s_{i+1}\ for\ 1\leq i \leq n - 2\ and\ s_i s_j = s_j s_i\ for\ |i-j| > 1\ and\ s_i^2 = 1\ for\ all\ i\right>
$
In both presentations, the elements listed to the left of the | are the generators of the group, and the equations to the right of the | are the "relations" satisfied by the generators.
Now, a close inspection of both presentations shows that $B_n$ and $S_n$ have the same number of generators, and the generators of $S_n$ satisfy all the relations between the generators of $B_n$ and some more, namely $s_i^2 = 1.$ Technically speaking, this means that the assignment $\sigma_i \mapsto s_i$ "preserves" the relations of the presentation of $B_n$ and thus defines a homomorphism $\phi: B_n \rightarrow S_n$. This conclusion is a general fact about presentations of groups.
Finally, since $\phi(B_n)$ contains all the generators of $S_n$ (by construction), $\phi$ is onto.
