Grounding rules around a swimming pool are essentially the same as grounding rules for any other line voltage device in your home. All power lines should have a green grounding wire, and that wire should be connected to the ground terminal on all line voltage devices. The only exception is double insulated pool pumps, which do not need to be grounded. However, double insulated pumps are rare, so that doesn't normally come up.
Bonding is more complex, with numerous pool specific rules in the electrical code. The goal of bonding is to prevent electrical current from flowing through people who are in, or touching, the water. Current will flow from any place that is at a high voltage to anywhere else that is at a lower voltage. Bonding makes sure that everything is at the same voltage. As long as everything is at the same voltage, no current will flow.
Bonding a pool typically involves running a thick copper wire all the way around the pool, and connecting it to everything metal within five feet of the water, to all electrical devices that touch the water, to any concrete within three feet of the water, and to the water it's self. If there are any voltage differences between any of those things, the bonding wire will short them out, forcing them to all be at the same voltage.
- Bonding never involves driving ground rods into the earth. Ground rods are only used for grounding the main electrical panel, and any sub-panels that are separate from the house.
- Temporary pools do not normally need to be bonded. Permanently installed pools do need to be bonded. Temporary pools are typically defined as above ground pools that have water less than four feet deep, although this varies somewhat from place to place.
- The bonding system and the grounding system are often connected together, especially in Canada where this is required. However, they serve distinct purposes and are essentially independent of each other.
- I have simplified a lot of the wording and removed many of the details. Do not use this as a guide for installing a bonding system. If you are installing a bonding system make sure you understand and follow the relevant electrical codes in your area.