Mechanical float valves -- "ballcock" valves -- are one of the very few moving components in your toilet, and are the only ones likely to break over time. While they may look a bit complicated, the ballcock assembly is actually fairly simple in terms of both form and function.
Purpose and Location
When you flush a toilets, the water inside its tank drains out through a rubber flapper valve in the bottom and into the bowl. As the water level drops, the ballcock valve opens and allows water to flow from the water supply into the toilet. The ballcock valve has two openings: one on the back that feeds into the toilet tank and another that pokes down into the drain hole below the flapper valve. This second port (the overflow tube) sends a slow stream of water over the walls of the toilet bowl to wash them while the toilet tank fills.
Both plunger-type and float-cup ballcock valves use a float to sense the water level. When the tank is full of water, the valve's float rises and pushes down on a lever arm in the top of the valve. This lever arm pushes the valve shut and keeps water from flowing into the tank. Once the float drops, the lever arm releases and the actuator pops up, thus allowing water to flow into the tank.
Plunger-type and float-cup ballcock valves differ only in the location of the float mechanism. The plunger-type consists of an air-filled rubber, plastic or foam ball attached to a long rod. The rod attaches to a pivot; a shorter section of rod on the rod goes down when the float side goes up, thus pushing the water valve's actuator rod shut. A float-cup type works the same way, but its doughnut-shaped float rides around the fill-tube "tower" instead of hanging off the end of a rod.
Failure and Repair
Running toilets are a common household failure, and it usually comes down to either a hung-open flapper valve or a maladjusted float. If your plunger-type ballcock won't shut off, bend the float rod downward toward the water. Cup-floats typically have an adjuster on the valve body. Replacing the ballcock assembly is fairly easy; you need only shut off the water supply, remove the valve nut from the bottom of the tank and replace the valve with a new cone washer.