It has always been my belief that grounding and the theory of it is the most difficult aspect of practical electrical. If you doubt this, try to trace out noise/ground loops in an audio system and fix the issue. Without getting too much into ground loops, here you go:
Electric potential, aka voltage, aka a difference in energy is point-to-point measurement of the concentration of electrons between two points. Because of this, we need a reference point to compare a point in question to. When electrical power is generated, we are creating a potential difference that allows electrons to move through a conductor (this is what current is) until both points are at the same potential (which would be 0V, they both contain roughly the same concentration of electrons). Once that happens, no more electrical energy is stored in the circuit, and electrons don't flow. Take a digital multimeter with a high resolution (thousandths of a volt) and go around just taking readings on random things (the wall to the floor, between the plastic on your computer monitor and the plastic on your keyboard, between you and a friend). You will see that you get very different readings between different objects. This electrical potential exists everywhere.
Now, when electricity is generated, that power is transmitted over very long distances, and given the above information it is quite easy to see how that can be a problem. I'm pulling these voltages out of my head, and real-life does NOT work this way, but let's assume that it does. Now let's say electricity is being generated at 120V and transmitted to several houses over several miles. At one house, the electricity may be at 180 volts, while another 32 volts, or any potential you can imagine. This is where a ground comes in.
By generating power at 120V relative to the EARTH we can minimize the difference in electrical potential over different areas, so that the electrical energy generated has close to the same potential across a much wider area and is much more stable. This gives us common "ground," pun intended, to compare potential to.
The grounding system in distribution systems serves the same purpose. I get roughly the same voltage reading from a functional, properly installed lighting system that I do from a receptacle installed in a wall outlet. We use the Earth as our reference point for voltage, the neutral as our return path for the circuit and bond the neutral and ground together at the first means of disconnect of a service entrance point to bring them to the same potential. We accomplish this bonding by many different means, the simplest of which is by driving long rods (5/8" by 8' is common) into the ground, then running a wire from that conductive rod up to the distribution panels of the electrical system. Utility lines have ground wires spaced out every so often to keep the electrical potential consistent as well. Let's cover some other topics.
Grounding systems are also used for equipment safety. By bonding the normally non-current-carrying parts of equipment, we can detect short circuits with specific devices (commonly called over-current and/or short circuit protect devices) like fuses and circuit breakers. This way, if the frame/chasis/etc of the device is raised to the line potential, current will flow without resistance causing the OCPD to open up the circuit, effectively de-energizing it.
Now, on to electronics. It is VERY important to be able to distinguish between earth-ground and floating ground (also referred to as "above-earth" ground). In electronics, we often have circuits that are not bonded to the earth. You can take a voltage reading between positive and negative, and may get something like 3, 5, 12, 24, etc volts. The reading would be completely different between either terminal and the earth, however within that electronic system, the negative (also called 0V or GND) is the ground for that system. That is a part of the reason this can get so confusing. Your car is a good example. It sits on rubber tires, so it is insulated from the earth. The frame of the car is actually used as a common reference point for voltage throughout the vehicle's electrical system, so it is effectively the ground for that floating-ground system.
So let's sum it all up. The ground is simply the common reference point for a generated voltage, regardless of how that voltage is generated. It could be chemical (car battery) or mechanical (generating rotating a magnet around a copper wire), it doesn't matter. Ground, in its broadest, loosest sense is the reference point for an electrical system so that voltages are fairly consistent throughout the system. Because of the variety in use, we segment them by referring to them as Earth (which is an Earth ground), common ground (which can be any reference point in an electrical system that is ubiquitous) or just plain old GND, which tends to be the voltage reference pin for DC and/or electronic systems.
Quite a long-winded post, but as I mentioned this isn't exactly a simple topic.Remember, Ground is ground the world round!