Most zoom lenses have variable apertures.
For example, the lens below zooms from 18mm to 55mm.
At 18mm, the physically largest aperture is f/3.5.
When you zoom the lens to 55mm, the effective aperture changes to f/5.6.
You can determine if your lens is variable aperture by looking at the lens barrel or at the front of the lens.
Below, the maximum aperture of the lens is 1: 3.5 - 5.6.
If a lens has a fixed aperture, it would be designated by a single value after the 1:, such as 1: 2.8.
Having a variable aperture allows the lens to be smaller.
This in turn makes the lens far less expensive and lighter.
A changing aperture doesn't affect most photographers, as the camera exposure system compensates for the change.
When using the Manual exposure mode, your camera may or may not adjust the exposure when zooming.
Check your camera instruction manual.
Let's say you have an 18mm to 200mm zoom lens.
At 18mm, at f/4, the effective size of the aperture is 4.5mm.
Focal length ÷ Size of the aperture = f/4
18mm ÷ 4.5mm = f/4
4.5mm is about 1/5th of an inch.
At 200mm, at f/4, the effective size of the aperture is 50mm.
200mm ÷ 50mm = f/4
50mm is almost two inches.
Therefore, the lenses in the zoom lens would have to be larger than two inches.
These large lenses are more expensive to make, and increase the size and weight of the zoom lens.
By using the variable aperture design, the lenses inside the zoom lens don't have to be as large.
At 200mm, at f/5.6 instead of f/4, the effective size of the aperture is only 35mm.
200mm ÷ 35mm = f/5.6
35mm is about one inch and a third.
The lenses in the zoom lens can be much smaller.
More accurately, an f/stop value is the ratio between the focal length and the diameter of the entrance pupil.
The entrance pupil is the apparent size of the aperture when viewed from the front of the lens.
This apparent size is not the actual diameter of the aperture.