Anti-siphoning capabilities are required by code on certain plumbing devices such as exterior faucets (sillcocks) and toilet fill valves (ballcocks).
An anti-siphon device acts as a one-way valve and is designed to stop the flow of potentially contaminated water back into the drinkable (potable) water supply.
Anti-siphon devices protect against a period of low water pressure in the supply line where contaminated water could be sucked back into the potable water supply.
An anti-siphon device on a fill valve or ballcock protects against the risk of siphoning back contaminated toilet tank water. On exterior faucets or sillcocks, the anti-siphon device protects against the risk of the faucet being connected to a hose that is immersed in contaminated water or attached to a chemical sprayer.
Modern US plumbing codes require the ballcock or exterior faucet to have an anti-siphon device as an integral part of the fill valve or faucet itself. The anti-siphon device can be a vacuum breaker or an air gap and is located on the water exiting side of the fill valve or faucet.