The temperature and the level of moisture in the air a hailstone forms in can influence how dense it is. In very cold air, water freezes as soon as it collides with the hailstone, but this can lead to a lot of air and being mixed with the ice. If the water freezes more slowly, perhaps because the air is warmer or the amount of moisture in the air is high, meaning not all of it freezes instantly, the air bubbles have time to escape.