Materials with a density lower than that of water are able to float in water. According to the Archimedes principle, objects generate a buoyancy force equal to the amount of fluid that they displace. Materials less dense than water generate enough buoyancy force to keep them afloat.
Materials that are immersed in a liquid experience different hydrostatic pressures on their upper and lower surfaces because of the difference in water pressure at different depths. The lower surface is pushed upwards by the hydrostatic pressure more than the upper surface is pushed downwards. This results in a net, upwards buoyancy force. Any material submerged either partially or fully in a fluid experiences this buoyancy effect to some degree. Some materials float, while others sink, because floating materials are able to generate a sufficient buoyancy force to float in the fluid they displace. The less submerged the material has to be for it to float in the fluid, the larger the corresponding buoyancy force that acts upon it. Because buoyancy force is proportional to the volume of the displaced fluid, the less dense a material is, the larger the effect of this buoyancy force becomes. This is because less dense materials have less weight that needs to be counteracted by the buoyancy force generated from their larger volumes.