Residual-current device

A ground fault circuit interrupter (GFCI), or Residual Current Device (RCD) is a type of circuit breaker. This type shuts off electric power (or breaks the electrical circuit), to protect people from an electric shock caused when some of the current travels through a person's body due to an electrical fault such as a short circuit, insulation failure, or equipment that is not working right. 
Standard circuit breakers shut off power when the current is too high, like 10, 15, or 20 amps. This protects machinery, and is often good enough to prevent hurting people. 
The GFCI / RCD, however, breaks the circuit when it detects an imbalance of only 0.005 amps (0.030 amps in Australia and some European and Asian countries). Even this small amount of current, 0.030 amps, going through one human body might possibly kill, by causing paralysis of skeletal muscles and stopping the human heart. 
A standard circuit breaker protects the house electrical wires, receptacles and switches, and appliances and fixtures from dangerous conditions, which could contribute to overheating and possible fire. A GFCI / RCD on the other hand, protects people from shock and electrocution and is often found in bathrooms or kitchens, but more specifically where electrical devices may be used near sources of water. While using electrical devices in these locations, someone's bare skin may be in contact with water or a wet floor or metal fixtures. Any of these can provide an alternate path for current to travel in the case of an electrical fault. 
A GFCI / RCD can also prevent dangers from short circuits and other electrical faults that don't involve humans such as a low current short where the current never reaches the trigger point for a circuit breaker, e.g. a live wire falls in a tub of water or moist soil and only 1 or 2 amps of current flow.
Types.
GFCIs are available in two types: the circuit breaker that installs in an electrical panel, and the receptacle type that installs into an electrical box.
Regulations.
GFCIs are a suitable replacement for two prong outlets without a grounded wire. The National Electric Code requires GFCI protection in dwelling on kitchen counter tops, bathrooms, unfinished basements not intended as habitable rooms, crawl spaces, garages, sinks where the receptacles are installed within 6 feet from the top edge of the bowl of the sink, boathouses, bathtubs or shower stalls where receptacles are installed within 6 feet from the edge of the bathtub or shower, laundry areas, outdoors except for receptacles that are not readily accessible and are supplied by a branch circuit dedicated to electric snow-melting, deicing, or pipeline and vessel heating equipment shall be installed in accordance with NEC 426.28 or 427.22 as applicable. (NEC 210.8 (A)) 
GFCI protection is required on construction sites.