Why isnt $a$ applied on $k$ in the equation $y=a[b(x-h)]+k$? For instance, if applying a vertical stretch by a factor of $5$ on the graph of  $y=x^2+1$ gives a new equation of $y=5(x^2+1)$, why isn't the same done in the equation of transformations $y=a[b(x-h)]+k\,?$

Shouldn't it be $y=a[b(x-h)+k]\,?$ 

 A: $$y=af(x)+k$$ applies vertical stretch first, then a vertical shift by $k$.
$$y=a(f(x)+k)$$
applies vertical shift first, then apply vertical stretch.
A: The answer is simply because the $k$ is just a shift factor. Multiplying the shift factor just changes how far it is shifted by. Stretching needs only be done on the terms with the input variable (in this case $x$). Try plotting an example function to see this more concretely. 
A: If you write the equation not as a function wherein the lefthand side must be exactly and only $y$, but an implicit equation where you can have both $x$ and $y$ on either or both sides of the equation, the mechanics become a lot more obvious.
To stretch a graph vertically, strictly speaking you shouldn't multiply anything; you should divide $y$ by the factor by which you want to stretch the graph.
Similarly, to translate the graph "upwards $7$ units," you should subtract $7$ from $y$ any place $y$ appears in the equation.
To translate the graph "right $2$ units," replace every instance of $x$ with $(x-2)$.
A: Here are a few of the basic transformations on equations in $x$ and $y$ and their corresponding effect of the graphs after the transformation.


*

*$x\to x-h$ translates the graph $h$ units horizontally.

*$y\to y-k$ translates the graph $k$ units vertically.

*$x\to\dfrac{x}{c}$ stretches (shrinks) the graph horizontally by a factor of $c$ if $c>1\,$ ($0<c<1)$

*$y\to\dfrac{y}{c}$ stretches (shrinks) the graph vertically by a factor of $c$ if $c>1\,$ ($0<c<1)$


From these four transformations the line $y=x$ can be transformed into any non-vertical line in the plane.
However, when the equation is a form where it has been solved for $y$, the exact transformations which occurred may be not so obvious, so one must 'unsolve the equation' for $y$.
In your example, $y=a[b(x-h)]+k$ the equation may be rewritten in the form
$$ \dfrac{y-k}{ab}=x-h$$
So its graph is as if the graph of $y=x$ had been shifted $h$ units horizontally, $k$ units vertically, then stretched (or shrunk) by a factor of $ab$  vertically.
Alternately, it could also be written in the form
$$ \dfrac{y-k}{a}=\dfrac{x-h}{\frac{1}{b}} $$
and its graph is as if the graph of $y-x$ had been shifted $h$ units horizontally, $k$ units vertically, then stretched (or shrunk) by a factor of $a$  vertically and by a factor of $\frac{1}{b}$ horizontally. Either way, the result is the same.
