The toilet float ball (not to be confused with the ballcock) regulates the water level within the tank. Depending on where (or how high) the float ball is placed within the toilet, the water will rise to match. If the float ball is too high, the toilet runs a risk of overflowing. Too high of a float ball also runs the risk of leaving your toilet constantly running, raising the cost of the water bill. However, if the float ball is left too low in the toilet, the water is unable to properly fill back up, which can cause mold and bacteria to form in the bowl due to lack of water.
The float ball interacts with a variety of the inner parts. It is attached vertically by a metal rod to the end of the flush lever or horizontally to the cap of the fill valve (depending on how high or low it is placed). It sits above the flush valve and discharge tube, next to the overflow tube.