The answer given by Mr. Jackson Walters gives a proof why it works, but if you are looking for an answer that should give an intuition, see this :
Consider the curve in the plane whose $x$-coordinate is given by $g(t)$ and whose $y$-coordinate is given by $f(t)$, i.e. $$\large t\mapsto [g(t),f(t)]. $$ Suppose $f(c) = g(c) = 0$. The limit of the ratio $\large \frac {f(t)}{g(t)}$ as $t \mapsto c$ is the slope of tangent to the curve at the point $[0, 0]$. The tangent to the curve at the point $t$ is given by $[g'(t), f'(t)]$. l'Hôpital's rule then states that the slope of the tangent at $0$ is the limit of the slopes of tangents at the points approaching zero.
Points to assume (credits : Thanks to Hans lundmark for pointing out what I missed and to Srivatsan for improving my formatting . )
Assume that functions $f$ and $g$ have a well defined Taylor expansion at $a$.
Proof:
Another way you can think of this is to use the idea of derivative: a function
$f(x)$ is differentiable at $x=a$ if $f(x)$ is very close to its tangent
line $y = f'(a) \cdot (x-a) + f(a)$ near $x = a$. Specifically,
$$f(x) = f(a) + f'(a) \cdot (x-a) + E_{1}(x)$$
where $E_{1}(x)$ is an error term which goes to $0$ as $x$ goes to $a$. In fact,
$E_{1}(x)$ must approach $0$ so fast that
$$\lim_{x\to a}\frac{E_1(x)}{x-a}=0$$
because $\dfrac{E_{{1}(x)}}{x-a} = \dfrac{ f(x)-f(a) }{x-a} - f'(a) $
and we know from the definition of derivative that this quantity has
the limit $0$ at $a$.
Similarly, if $g$ is differentiable at $x = a$,
$$g(x) = g(a) + g'(a) \cdot (x-a) + E_{2}(x)$$
where $E_{2}(x)$ is another error term which goes to $0$ as $x \to a$. If you're
computing the limit of $f(x)/g(x)$ as $x \to a$ and if $g(a)$ is not equal to
$0$, then as $x \to a$, the numerator becomes indistinguishable from $f(a)$
and the denominator from $g(a)$, so the limit is
$$\lim_{x \to a} \frac{f(x)}{g(x)}=\frac{f(a)}{g(a)} .$$
If both $f(a)$ and $g(a)$ are $0$, then we must use the tangent
approximations to say that
$$\frac{f(x)}{g(x)} = \frac{f(a) + f'(a) \cdot (x-a) + E_{1}(x) }{ g(a) + g'(a) \cdot (x-a) + E_{2}(x) }$$
$$=\frac{f'(a) \cdot (x-a) + E_{1}(x)}{g'(a) \cdot (x-a) + E_{2}(x) }$$
$$ =\frac{f'(a) + [E_{1}(x)/(x-a)] }{g'(a) + [E_{2}(x)/(x-a)]}$$
and we have seen that the second term becomes negligible as $x\mapsto a$.
In other words, when both function values approach $0$ as $x\mapsto a$, the
ratio of the function values just reduces to the ratio of the slopes
of the tangents, because both functions are very close to their
tangent lines.
I hope you understood. Thanks a lot. Iyengar.