The Intuition behind l’Hopitals Rule

I understand perfectly well how to apply l’Hopital’s rule, and how to prove it, but I’ve never grokked the theorem. Why is it that we should expect that
but only when specific criteria are met, like $f(x)$ and $g(x)$ approaching $0$ as $x \to a$? I’ve never found the proof of the theorem to shed much light on this (thought this might be because I don’t have much of an intuitive sense as to why the Cauchy Mean Value Theorem holds, either). I’ve always been mystified as to how l’Hopital (Bernoulli?) ever discovered this theorem, beyond accidentally discovering that it holds in some cases and then generalizing it to a theorem. So, if you have any ideas as to where the theorem came from, and why it makes intuitive sense, I’d appreciate it if you shared them!