Here's a good description i grabbed from online:
The ground-fault circuit interrupter is a fast-acting device which senses small current leakage to ground and, in a fraction of a second, shuts off the electricity and interrupts its faulty flow to ground. The rapid response of the GFCI is fast enough to prevent electrocution and this protection is independent of the condition of the grounding conductor.
Though a GFI will activate if a grounded appliance develops an electrical short circuit to ground... such as when YOU touch a metal saw and become the path to ground... you will experience a momentary electrical shock. This could be a minor tingle or could be more catastrophic, especially if you are on a ladder or roof.
According to the NEC, it is allowable to install GFI's in ungrounded situations. This makes sense, since the GFI is not dependent of the ground to function. It does not measure shorts to the ground, it measures the current difference between the hot and neutral wires. A sudden difference, indicating that there is another path for the electricity to flow through... you, for example, causes the GFI to open the circuit and save you from permanently curly hair.
The NEC allows GFI's to be installed in ungrounded situations PROVIDED THAT the outlet is labelled "ungrounded". Though not "officially" approved in the NEC, the grounding hole in the GFI can be permanently defeated by using an epoxy or other adhesive to seal the hole.
Most safety-conscious electricians prefer not to install a grounded-type "three prong" outlet in an ungrounded situation. Think about it... once the outlet is installed, there is no way for anyone to know if the outlet is really grounded or not without testing it. Thus, there is a hidden shock hazard should an appliance or tool that needs grounding... has three-prong plug... is plugged into this outlet.