The camera lens is a converging lens. Light rays entering the lens are caused to bend inward due to the shape of lens and its material of construction. We can trace out the path of these light rays as they travel inside the camera. This trace resembles a cone of light. The distance from lens to the apex of this cone is the focal length. This measurement is taken when the object being imaged is at an infinite distance. The ideal target for this assessment is a star. However, lens makers make this measurement indoors on an optical bench that creates an artificial star using a focused light source.
Now the camera lens suffers from seven major aberrations that combine to degrade the resulting image. To mitigate this, a quality camera lens is a complex array of several lenses of different shapes (powers). Some are convex, some are concave, some are dense glass, some are less dense. Such construction shifts the measuring point. This point is called the rear nodal. It could fall at about the center of the lens barrel or in the air behind or ahead of the lens. Generally it falls somewhere within the lens barrel.
The distance from the rear nodal to the image plane is a variable based of subject distance. It is at its shortest when imaging a distant object. This distance steadily elongates as the target object gets closer the camera. As an example, when doing extreme close-up photography, this distance, now called the “back focus”, can be quite long. If you are working in close, and achieve life-size, the distance from the rear nodal is twice the focal length.