Groundwater is generally uncontaminated because rain water travels through many layers of sand before it reaches the permeable rock strata. As the water travels down, any debris or bacteria is filtered out. However, when oil and gas wells are drilled through the water bearing strata, if the hole is not properly cemented shut, a pathway could be established for contamination of the ground water. Similarly, in hydrolic fracturing ("fracking") a large amount of drilling mud is forced down wells under high pressure with the goal of making cracks in the strata that hold the oil and gas. Such cracks could establish new pathways for contamination and the drilling mud could be a possible contaminate.
In many geological formations, a strata that is impermeable to water is on top of the permeable rock strata. However, if there is an area (even many miles away) where water can seep down to the permeable strata, an underground river can develop to carry the water. For this reason, groundwater can be accessed by drilling water wells in areas with little rain, because the groundwater originated in distant areas with more rainwater.