In a diagram of the geometry, you see that the angle of elevation is opposite the triangle leg representing the tree height, and is adjacent to the triangle leg representing distance from the tree.
The tangent ratio relates these lengths to the angle: