Float switches range from small to large and may be as simple as a mercury switch inside a hinged float or as complex as a series of optical or conductance sensors producing discrete outputs as the liquid reaches many different levels within the tank. Perhaps the most common type of float switch is simply a float raising a rod that actuates a microswitch.
A very common application is in sump pumps and condensate pumps where the switch detects the rising level of liquid in the sump or tank and energizes an electrical pump which then pumps liquid out until the level of the liquid has been substantially reduced, at which point the pump is switched off again. Float switches are often adjustable and can include substantial hysteresis. That is, the switch's "turn on" point may be much higher than the "shut off" point. This minimizes the on-off cycling of the associated pump.
Some float switches contain a two-stage switch. As liquid rises to the trigger point of the first stage, the associated pump is activated. If the liquid continues to rise (perhaps because the pump has failed or its discharge is blocked), the second stage will be triggered. This stage may switch off the source of the liquid being pumped, trigger an alarm, or both.