The figure reads from left to right: B takes u∈U to Bu∈V, and A takes that vector on to A(Bu)∈W. The curved arrow is the single map AB:U→W that does both steps at once. The middle space must match: B has to land in V, where A is defined, otherwise A(Bu) has no meaning.
B turns u by θ, then A acts: (AB)u=A(Bu). Show BA as well to see that the order usually matters.
The composition is again linear: B turns u+v into Bu+Bv, and A turns that into ABu+ABv; scalar multiples pass through both maps in the same way. For matrices, [AB]=[A][B], and the matching middle space becomes the size condition: A is m×n and B is n×k. Composition is associative, since (AB)C and A(BC) both mean "first C, then B, then A".
A common slip is to apply A first because it is written first. The order matters: on R2, let A(x1,x2)=(x1,0) and let B(x1,x2)=(x2,x1) swap the coordinates. Then AB(x1,x2)=(x2,0) but BA(x1,x2)=(0,x1), so AB=BA, just as composition of functions is not commutative.