The earth pin on a plug is longer than the live and neutral pins. This means the earth pin is the first to connect and the last to disconnect.
When inserting the plug, the earth connection is made before the current-carrying contacts of the plug become live.
The current-carrying contacts shall separate before the earth connection is broken when withdrawing the plug.
Thus, the earthing connection is always maintained to improve safety.
Many wall sockets have safety shutters (see image) on the live and neutral lines to prevent children from inserting conducting materials, resulting in electric shock. Inserting a longer (earth) pin helps open the shutters, facilitating the insertion of the other two pins. These are called Earth-pin operated shutters.
Though it is impossible to insert the plug into the socket upside down, one may try to insert the plug top in a misaligned position (e.g. trying to insert the earth pin into the phase socket with the other two pins further down out of the socket). Hence, the ground pin is made thicker so that even by mistake, it cannot be inserted into the live or neutral hole of the socket. This prevents the earth pin from establishing electrical contact with the live terminal.