The earth is a pretty good conductor of electricity and it is huge, so it makes a good return path for electrons. The term "grounding" comes from the fact that the earth because of its size has a gigantic capacity to accept (or donate) electrons in response to a difference in voltage of some other device. So, in most cases whatever is attached to the earth (ground) is assigned a potential (voltage) of zero.