In Leibniz notation, the last "step" can be seen as follows:
$$\frac{d\ f(g)}{dt}=\frac{d\ f(g)}{dg}\frac{dg}{dt}$$
Intuitively, you could imagine the "$dg$" cancelling to give you equality, but you'll have to take care of any divisions by $0$ and similar things. As per what it means, I think an example is good.
Let $f(t)=\sin(t)$ and $g(t)=t^2$.
then $f'(t)=\cos(t)$ and $g'(t)=2t$.
By the chain rule, we finally have
$$\frac d{dt}\sin(t^2)=\cos(t^2)\cdot2t$$
As I like to say, take the derivative of the outside $(f')$ and keep the inside $(g)$ the same, then multiply the result by the derivative of the inside $(g')$.