Earthing is defined as the process in which the instantaneous discharge of the electrical energy takes place by transferring charges directly to the earth through the low resistance wire
Earthing is used to protect you from an electric shock.
It does this by providing a path for a fault current to flow to the earth.
It also causes the protective device (either a circuit breaker or fuse) to switch off the electric current to the circuit that has the fault.