Let $g_1,g'_1, g_2, g'_2$ be loops on a topological space $X$ at $x_0 \in X$. Suppose that $[g_1]=[g'_1]$ and $[g_2]=[g'_2]$. Then let a map $F: [0,1]\times [0,1] \to X$ be defined as $$ F = \Big\{ \begin{array} \,F_1(2t,s), & 0\leq t \leq \frac{1}{2} \\ F_2(2t-1,s), & \frac{1}{2} \leq t \leq 1 \ \end{array} $$where $F_1:[0,1]\times [0,1] \to X$ is a homotopy between $g_1,g'_1$ and $F_2:[0,1]\times [0,1] \to X$ is a homotopy between $g_2,g'_2$ and where the homotopies $F_1, F_2$ map $(0,s)$ and $(1,s)$ to $x_0$ for all $x_0 \in X$. Thus, the proof says, $[g_1 \cdot g_2 ] = [g'_1 \cdot g'_2]$ showing that the group operation on $\pi_1(X,x_0)$ is well defined.
Why the last statement is a proof that the group operation is well defined? I understand everything up to the word "thus".
P.S. Geometrically or pictorially I do understand very well why $\pi_1(X,x_0)$ is a group. So a connection to this in the previous proof would help a lot.
Note that the definition $[g_1][g_2] = [g_1\cdot g_2]$ might not be well defined. Namely, we must check that if we have $g_{1}'\neq g_1$ such that they are homotopy equivalent, then we must have $[g_1\cdot g_2] = [g_1][g_2] = [g_1'][g_2] = [g_1'\cdot g_2]$. Similarly for $g_2$ we must do the same, which can be combined into saying that $[g_1\cdot g_2] = [g_1'\cdot g_2']$. The proof constructs a homotopy between these two maps, which proves this statement.