Viewing a 2-category as a category enriched in $\mathsf{Cat}$, I can see from where comes the vertical composition: morphisms of a 2-category are objects of $\mathsf{Cat}$ and 2-morphisms of this 2-category are morphisms of $\mathsf{Cat}$, so they can be (vertically) composed if they're composable.

What I don't see, is from where the horizontal composition comes, in the diagram

we can get the composite $g_1 g_2$ and $g'_1 g'_2$, these will be in turn also objects of $\mathsf{Cat}$ and may eventually have no morphism between them! The horizontal composition $\alpha_1 \circ \alpha_2$ make no sens in this case.
So my question: can we always define the horizontal composition in a 2-category for all 2-morphisms?
EDIT To make my question more clear, is it suffisant to say that each "hom-collection" must be a category to define the horizontal composition of 2-morphisms?
It comes about by applying the composition functor (composition being an arrow in $\text{Cat}$),
$$\hom(b, c) \times \hom(a, b) \to \hom(a, c)$$
to a pair of morphisms, one in the hom-category $\hom(b, c)$ (where we have a morphism $\alpha_1$ between objects $g_1$, $g_1'$) and the other in the hom-category $\hom(a, b)$ (where we have a morphism $\alpha_2$ between objects $g_2$, $g_2'$).