It's one of the ways it can control altitude. Ballonets work quite well, including in modern airships.
What they do is allow the helium inside the airship to take less than its full volume, by taking up the rest of the airship's volume with air. Buoyancy comes from space where you don't have air, and displacing helium with air reduces that space.
Ascending requires having more helium volume, descending less helium volume. Since the same amount of helium takes more volume at high altitude (less pressure), it works out without a need to vent it.
For an easy analogy, take a submarine. It can float because it's filled with air. Replace some of that air with water - fill the ballast tank - and it sinks. In an airship, outside air acts like water. Water is neutrally buoyant in water, but it reduces the space filled with positively buoyant air.
Think of the ballonets as ballast tanks. The only difference is that helium isn't discarded, since it's difficult to replace.
Expanding the ballonets compresses the helium a bit, but just for a moment, the airship then sinks to where outside pressure is higher, restoring the equilibrium. That small temporary pressure change is easily exerted with blowers.
Alternately, after altitude is changed aerodynamically in forward flight or with propellers, the ballonets need to be expanded or reduced in size to match the new external pressure.
In the picture below, see how the volume of the airship is part helium and part air: