In order to get a good picture of an object, a lens needs to be focused. Focusing is just creating the proper image distance to match the object distance of the object you wish to photograph. That can be accomplished in a couple of different ways. The main ways are block focusing and internal focusing.
Block focusing involve moving all of the lens elements closer to or farther from the detector. This means that you are directly changing the image distance. To focus closer, the lens needs to move away from the detector. This is seen by the lens lengthening. Many older lenses use this method.
Many newer lenses use internal focusing. Internal focusing move individual elements of the lens in relation to each other to acheive a sharp focus. Internal focus lenses can be identified by the fact that they don't change in length with focusing. Moving the lens elements in relation to each other causes the focal length of the lens to change. Shortening the focal length while keeping the amount of extension constant means that the lens will focus closer.
If my 100 mm macro lens has a 100 mm focal length at infinity focus, it may only be 50 mm at close focus. Since my image distance was 100 mm at infinity focus, that same distance will now equal 2 x 50 mm at close focus. That means that the camera will now focus at 1:1. If . To focus a 100 mm lens without changing the focal length I would need an additonal 100mm of extension. By changing the focal length, I can get the same magnification with no significant increase in extension.
Internal focusing has a couple advantages over block focusing. First, moving individual elements is easier than moving all of the elements. This makes autofocus easier and faster. Secondly, a lens that block focuses will typically (not always) turn as the focus is adjusted. If you are using a polarizing filter with this lens you will have to adjust the filter every time you adjust the focus. With internal focusing, the external lens filter dosen't need to turn as the focus is adjusted making filters easier to use.
The drawback of shortening the focal length as the lens focuses closer is that the object distance is also related to the focal length. Because of this you will also lose a portion of your working distance as you focus closer. For a longer focal length lens, this tradeoff won't make a big difference, but can be a significant problem for shorter focal length lenses.