Suppose the picture is taking place in the ambient space $X$ and $\gamma, \gamma' : [0,1] \to X$ are the loops based at $x_0$ labelled $B_1$ and $B_1'$ respectively, then $\gamma(0) = \gamma(1) = x_0$ and $\gamma'(0) = \gamma'(1) = x_0$. Their concatenation is $\gamma\ast\gamma' : I \to X$ given by
$$\gamma\ast\gamma'(t) = \begin{cases} \gamma(2t) & 0 \leq t \leq \frac{1}{2}\\\ \gamma'(1-2t) & \frac{1}{2} < t \leq 1. \end{cases}$$
Note that $\gamma\ast\gamma'(t) = x_0$ when $t = 0, \frac{1}{2}, 1$. Homotopy of loops is relative to the subset $\\{0, 1\\}$. That is, when you deform the loop $\gamma\ast\gamma'$, you only need to keep its values at $t = 0$ and $t = 1$ fixed, all the others can vary. In particular, as you deform the loop, its value at $t = \frac{1}{2}$ may not stay fixed at $x_0$ as is illustrated in the second picture.