The zone of depth of field is not split down the middle. As a rule, DOF extends 2/3 further away and 1/3 back towards the camera, measured from the point focused upon. DOF has many ingredients.
- Subject distance – When imaging distant objects, the zone of DOF expands. When imaging nearby objects, the zone of DOF is shallow.
- Focal length – We maximize the zone of DOF when the lens is set to wide-angle (shortest focal length). We shrink the span of DOF when we zoom to maximum focal length (telephoto).
- Aperture – Maximum DOF is obtained when the aperture diameter is small. f/22 yields the greatest DOF, whereas f/3.5 delivers the shallowest DOF.
A setting of 18mm focal length combined with a tiny diameter aperture like f/22 grants maximum DOF. When you zoom to 55mm you are entering into the realm of telephoto. Now the magnification increases (objects appear closer), however the image gets dimmer. As you zoom from a lesser focal length, the mechanics of the lens attempts to compensate. In other words, as you zoom the lens’s apparent diameter increases.
A more costly lens would likely maintain the maximum aperture of f/3.5 as you zoom. However your kit lens runs out of working diameter, and the f/# changes during the zoom. The good news is, the difference between f3.5 and f/5.6 is not significant. Likely you will not notice a significant change in bokeh.