What is the function of ground fault circuit interupter?

The function of a GFCI is any fault to ground will automatically trip the circuit. For example, if a hairdryer is plugged into a GFCI receptacle and it is dropped into a sink of water, the GFCI will shut down power to the receptacle.