It’s because of upthrust (also called buoyant force). According to the Archimedes' principle, any object, partially or fully immersed in a fluid, experiences an upthrust equal to the weight of the fluid displaced by the object. And the apparent weight is given by Wapparent=Wactual−Upthrust.