Here is a sketch of the proof that an AVL tree with N keys has height h = O(log(N)).
Let f(h) be the minimum number of keys in an AVL tree of height h.
(For example, try to draw AVL trees of heights 1, 2, and 3 with the smallest number of keys.)
f(-1) = 0
f(0) = 1
f(1) = 2
For h >= 1,
