The numbers shown in that gif are the focal length, but the change in perspective is indeed actually due to the camera’s distance from the subject. When you are close to a person with a wide lens, their nose is considerably closer to the camera than their ears and hair, so it appears bigger. When you are further away with a nice telephoto lens for portraits, all their facial features are roughly the same distance away, so they all appear the same size.
The numbers shown in that gif are the focal length, but the change in perspective is indeed actually due to the camera’s distance from the subject. When you are close to a person with a wide lens, their nose is considerably closer to the camera than their ears and hair, so it appears bigger. When you are further away with a nice telephoto lens for portraits, all their facial features are roughly the same distance away, so they all appear the same size.