Hydrogen, helium and warm air are lighter than the surrounding air. When filled with light gas or heated air, the volume of the balloon or airship displaces the surrounding air. That is why these aircraft ascend, like a bubble of air in water. That is the principle of static buoyancy.