The function of a water tank float valve is to control water flow into the tank. Most water tank float valves use a long lever attached to a buoyant float called a ballcock. When the water level rises to a certain point, it lifts the ballcock, which then lifts the lever, closing the valve. As the water level in the tank drops, the ballcock and lever also drop, reopening the valve and allowing more water to flow into the tank.
One of the most common applications for water tank float valves is in toilet tanks. Most toilet tank float valves use a hollow plastic or rubber ballcock attached to a long metal lever, but some models use a plastic ballcock attached directly to the valve without a lever. When a person flushes the toilet, a rubber valve opens in the tank's base, and water flows out of the tank and into the bowl, causing the ballcock to drop. When the person lets go of the flush lever, the rubber valve seals the tank, and water flows back in until the ballcock rises sufficiently to cut off the supply.
In toilet tank float valves, users can change the length of the lever attached to the ballcock to increase or decrease the amount of water the toilet uses for flushes. A very long lever uses less water, but also produces less powerful flushes. A short lever, on the other hand, provides very powerful flushes but decreases efficiency.