A toilet float is an important component in the toilet's fill valve; the float moves upward and downward, depending on the tank's water level. There are many types of floats, with the specific type of float needed depending on the fill valve's design. Regardless of the design, the float is an essential component because it signals to the valve how much water to allow into the tank. Sometimes the float gets stuck in the up position, which stops the tank from being filled. Even more problematic is when the float is stuck down -- that's when the tank will overfill.
When the toilet's water tank is full, the float rises to the top. Whenever the toilet is flushed, the water level decreases. This causes the float to lower, triggering the fill valve and causing the tank to fill with water again. Water continues to flow into the tank until the float rises high enough to trigger the stop mechanism on the valve, thus shutting off water flow.
Modern toilets often have a fill valve that has a collar around the main body. Older toilets use the ballcock assembly, which has a sphere-like float attached to a plastic or metal arm and is more prone to sticking when its washer ages.
The float needs to be able to lower to trigger the valve. A stuck collar float is usually caused by the collar rubbing against the side of the tank, which can be fixed by turning the float so that it no longer rubs on the side of the tank. Ballcock floats can also rub against the tank walls. You can bend or twist the metal or plastic arm so it no longer rubs against the walls.
If problems are still occurring with your ball float, removing the toilet tank cover and using a tape-check technique will often solve the problem. This technique involves taping around the rod of the float and then unscrewing it. Give it a quick shake, and listen carefully. If you can hear water inside of the float, then it has been compromised and needs to be replaced. Newer collar floats don't have this problem.