The float valve, often combined with a ball cock, is a device used in plumbing to maintain a constant water level in tanks and prevent overflow. The ball cock consists of a float that rises and falls with the water level, controlling the valve to open or close as needed.
When the water level in the tank rises, the float rises with it and eventually closes the valve to stop the flow of water, preventing overfilling.
Gate, globe, and butterfly valves are different types of valves used for regulating water flow, but they are not specifically designed for maintaining water levels or preventing overflow.