When you zoom,the aperture get's higher as you zoom to the most tele end of the lens.So example a 18-55 lens,at `18mm it will be at f3.5 while at 55mm it will be at f5.6
Very simple. This lens has a fixed diameter over a focal range. And aperture is based on the lens diameter to the focal length. Thus at the wider focal length, the aperture is f3.5 ratio based on the aperture diameter to the lens focal length. And NOW when you zoom in, the aperture size is still the same but the ratio to the focal length has changed and now gives you a aperture of f5.5 instead.
Those higher end lenses with fixed aperture has a varying aperture size which adjusts itself to give a constant aperture ratio even at the longer focal lengths, and this is more difficult and more expensive.