Contamination can reach groundwater in two ways - vertically or laterally. People can't do much about lateral flow except by not providing a flow gradient.
For example, if you live next to the sea and pump your fresh water well like crazy, you may provide a flow gradient for salt water in to your well. Vertical contamination is another issue. You spill diesel onto the ground and it will percolate downwards. Simple physics. Except the pollutants might not actually reach the water table. There may be layers of adsorpent (not absorbent) clays or scoria that hold the pollutants or delay them enough to break down. Or there may be a good impermeable barrier such as a clay layer that prevent movement at all. Note that in old fashioned gravity filtration for water purification, bacterial and viral pollutants can be stopped by quite a thin layer of filter sand. Of course, the best way to avoid vertical pollution is not to have pollutant spills.