Variable aperture comes into play if you have a zoom lens. If your lens has two numbers, i.e., F/3.5 to F/5.6, you have what’s called a variable aperture lens. This means your widest aperture (lower number) is different at different focal lengths.
The variable aperture allows the camera manufacturer to make the lens for less money. These lenses are often smaller and lighter than their fixed aperture counterparts.
Constant aperture lenses are heavier and require more sophisticated glass, which costs more money. They are generally of higher quality than variable aperture lenses.
The aperture functions independently of the lens focal length on a fixed aperture lens. Another advantage of fixed aperture lenses is that typically, their lens barrel doesn’t extend or retract when the focal length changes. This means they don’t get physically longer when you zoom.
Should you buy fixed or variable aperture glass? It depends on how serious you are about your photography, what your goals are and how skilled you are.
Most beginners, casual amateurs and snap shooters will never need the fixed aperture zooms. And all zooms made within the last five years are significantly better than the zoom lenses (even the expensive ones) I used in the 70s and early 80s.