Electric motors are usually made of a frame that conducts electricity. Over time, charge builds up in this motor. If a person touches the frame at this point, the current will have the person as the path of least resistance and the current will flow through him shocking him. To prevent this, the motor’s frame are grounded.
This means they are connected to the earth so that the path of least resistance becomes this connection to the ground. In the presence of this connection the current does not flow through the body and the human is protected from electrical shock.