The focal length of a lens is a measurement taken when the lens is imaging a far distance object like a star. If the lens structure is a single symmetrical (convex – convex) then this measurement is taken from the center of the lens to the focused image. A distant object is at an infinite distance when its light rays arrive at the camera lens as a bundle of parallel rays.
For all practical math purposes an object is at an infinite distance 1000 meter (1000 yards) distant. The ray trace starts from a single point on the subject and is then extended to show how it traverses the lens. The ray trace is then continued showing its path downstream from the lens. If properly focused, the trace inside the camera will depict a triangle with its apex just kissing off on the surface of the digital image sensor or film. The key point being, the ray trace is just a single point on the subject.
In actuality every point on the subject could be ray traced. Such a ray trace reveals that each point on the subject has a ray trace that resembles a cone of light. You see, the lens works by fracturing the light from a subject (vista) into a googolplex of cones of light. Each has an apex. Since all lenses have optical defects called aberrations, the apex of each ray trace as they kiss off on the sensor is never a point; it is actually a tiny circle of light juxtaposed with others and it has scalloped boundaries. Because it is seen as an imperfect circle jumbled with others, it is called a circle of confusion. The image derived from the lens is thus, countless cones of light each with an apex that kisses off on the sensor. As a rule, a ray trace to show the focal length is just a trace of a ray passing through the center (axis) of the lens. All the other rays are not shone.
Opticians are unable to eliminate these aberrations. The best that can be done is to mitigate each. This is done by designing the lens so that it consists of several glass elements. Some are dense glass, some are less dense, some are convex with positive power, and some are concave with negative power. Some are cemented together, some are air-spaced. The air-space has a figure (shape) formed by the surfaces of lens that sandwich it in. This lens shaped air-space also acts like a weak lens. There are seven major types of aberrations. To mitigate is takes seven or more glass lenses of different powers.
Because the camera lens is a complex array of glass, the measuring points used to find object distance and image distance are two cardinal points or nodal. Their placement likely does not fall in the center of the lens barrel. The forward nodal is the measuring point for object distance. The rear nodal is the measuring point for image distance.
The optician, likely uses lenses of different powers and this causes the nodal points to be shifted around. A true telephoto lens, as compared to a long lens of the same focal length, has its rear nodal moved forward. It can even fall in air ahead of the lens. This shortens the lens barrel making it less awkward than its long lens counterpart. Often, a wide-angle lens has a focal length too short to reach the image sensor / film. The optician shifts the rear nodal to lengthen the back-focus (distance last lens to film/sensor).
The focal length is measured from the rear nodal to the apex of the cone of the image forming rays. When we focus on an object closer than infinity, the cone of the image forming rays is elongated due to the fact that then has limited refractive powers. Refract is Latin to bend backwards or inwards.
The key point for you: Ray traces to show focal length are simplified drawings, likely only the axial rays are shown. The way a lens works is to fracture the subject into countless points. Each sends out light rays that traverse the camera lens. Each traces out a cone of light. There will be a googolplex of cones of light and thus a googolplex of circles of confusion. When focusing on objects closer than infinity we focus by moving the lens further away from the film / sensor.
Nobody said this stuff is easy!