The wire in electric fittings are earthed so that

Current may pass to the earth in case of a short circuit, without doing any harm

There may be a smooth flow of electricity

Electricity may not leak

To prevent a short circuit