Why Earth wire are long
Connect first, disconnect last
When plugging, the longest pin of the earth connection makes the plug comes in contact first with the earth. And on unplugging the phase can disconnect before the earth connected has separated from the plug. Thus the device maintains a connection with earth before the socket phase line touches the current carrying contacts of the plug. And disconnects the earth only after the phase disconnection. So even the supply to the socket is ON during the plugging, a complete earthing can be ensured.