Suppose \begin{align} p & = 2x + 3y \\ q & = 3x - 7y \\ r & = -8x+9y \end{align} Represent this way from transforming $\begin{bmatrix} x \\ y \end{bmatrix}$ to $\begin{bmatrix} p \\ q \\ r \end{bmatrix}$ by the matrix $$ \left[\begin{array}{rr} 2 & 3 \\ 3 & -7 \\ -8 & 9 \end{array}\right]. $$ Now let's transform $\begin{bmatrix} p \\ q \\ r \end{bmatrix}$ to $\begin{bmatrix} a \\ b \end{bmatrix}$: \begin{align} a & = 22p-38q+17r \\ b & = 13p+10q+9r \end{align} represent that by the matrix $$ \left[\begin{array}{rr} 22 & -38 & 17 \\ 13 & 10 & 9 \end{array}\right]. $$ So how do we transform $\begin{bmatrix} x \\ y \end{bmatrix}$ directly to $\begin{bmatrix} a \\ b \end{bmatrix}$?
Do a bit of algebra and you get \begin{align} a & = \bullet x + \bullet y \\ b & = \bullet x + \bullet y \end{align}\begin{align} a & = \bullet\, x + \bullet\, y \\ b & = \bullet\, x + \bullet\, y \end{align} and you should be able to figure out what numbers the four $\bullet$s are. That matrix of four $\bullet$s is what you get when you multiply those earlier matrices. That's why matrix multiplication is defined the way it is.