One of the big, contentious questions about the fracking boom in the United States is whether all that new drilling can contaminate nearby drinking water with natural gas (methane) or other chemicals.

The Water contamination was coming from faulty wells — not fracking itself

In recent years, as energy companies have used hydraulic fracturing to extract gas from shale rock in Pennsylvania and Texas, a number of homeowners have complained that their drinking water is getting contaminated. Since 2008, Pennsylvania has seen more than 20,000 new wells drilled and 243 reported cases of water contamination.

This week, a new study in the Proceedings of the National Academies of Sciences shed some light on what's going on. It found that the fracking process itself — in which shale rock thousands of feet below the surface gets cracked open — didn't appear to be polluting the water.

But there was a crucial caveat: The PNAS study also found that the vertical wells through which the gas is pumped up to the surface can sometimes leak, often due to faulty cementing. And those leaks appear to have caused some of the water contamination that people in Pennsylvania and Texas are reporting.

This may sound like a trivial distinction. After all, without fracking, many of those wells wouldn't even exist in the first place. But the study's authors noted that this was potentially encouraging news for the shale-gas industry, since faulty cementing is fixable, at least in theory.

But in another way, the news is worrisome. Just because the problems are fixable doesn't mean they necessarily will get fixed. A number of oil and gas wells around the country are thought to be poorly cemented, and no one knows how many, exactly. What's more, regulations around well construction can vary widely from state to state. So here's a rundown of both the latest study and the larger controversy:

How fracking works — and how it might pollute the water

Let's first take a closer look at how energy companies actually use hydraulic fracturing to extract natural gas from shale rock. Let's take a sample operation in the Marcellus Shale in Pennslyvania:

1) First, a well needs to be drilled all the way down to the layer of gas-rich shale. This shale layer can sit more than 5,000 feet underground and drilling can take as long as a month. The well is typically lined with cement and a steel casing to prevent any leakage into groundwater near the surface.

There are several stages where drilling could, conceivably, pollute the water

2) Once the drill reaches all the way down to the shale layer, it slowly turns and begins drilling horizontally, for a mile or more along the rock.

3) A "perforating gun" loaded with explosive charges is lowered to the bottom of the well and punctures tiny holes in the horizontal section of the casing that's deep down in the shale layer.

4) Now comes the actual "fracking," or "completion" stage: A mixture of water, sand, and chemicals is pumped into the well at extremely high pressures and goes through the tiny holes in the casing. The fluids crack open the shale rock. The sand holds those cracks open. And the chemicals help the natural gas seep out.

5) The "flowback" stage: The water and chemicals flow back out of the well and are taken for disposal or treatment.

6) Finally, natural gas begins flowing from the shale and up out of the well, where it's eventually shipped to consumers via pipeline. A typical well can produce gas for 20 to 40 years, pumping out thousands of cubic feet of gas each day.

That's a rough overview. Now, there are lots of different points during the above is process in which gas or chemicals could potentially leak into the water supply — as the chart below from the PNAS study shows:

Possible sources of water contamination from shale-gas operations:

For starters: Natural gas could migrate naturally from existing gas pockets into drinking water. This has nothing to do with drilling, but it can happen.

Alternatively, gas being pumped up from the shale layer could leak out of the well near the surface. Or, if a well is drilled through a gas pocket close to the surface, the gas could migrate up along the side of the well, especially if there's improper cementing.

There's also a more disturbing possibility: The cracks made deep underground during the fracking process could somehow migrate all the way up to the water table — allowing gas and possibly some chemical-laced fluids to seep into drinking water. This is the one possibility that's been widely feared.

What the latest study found

The PNAS study, led by Thomas Darrah of Ohio State, looked at 133 cases of suspected contamination in Pennsylvania and Texas and chemically analyzed the methane and chemicals in the groundwater to identify the source.

There was no evidence that cracks deep down in the shale layer were migrating to the surface

They found that many instances of contamination were actually due to "natural" leaks — methane migrating naturally from nearby gas pockets into the water. This was unfortunate, but had nothing to do with drilling operations.

Then they looked more closely at cases that could be linked to drilling. They found that the leaks were usually due to problems with the wells themselves. Sometimes the casings were faulty. Other times, gas seeped up around the outside of the pipe — likely due to improper cementing.

But the researchers didn't find any evidence that cracks deep down in the shale layer, where fracking occurred, were migrating up to the surface. (How could they tell that? The proportions of neon, helium, argon and other noble gases that appeared in the groundwater would have been different if the leaks were coming from deep underground.)

That finding jibes with what many experts had long suspected, since there are thousands of feet and many different layers of rock separating the fracked shale layer from the surface.

It also agrees with a separate Department of Energy study released this week in which researchers monitored a single hydraulic fracturing operation in Greene County, Pennsylvania for 18 months. This was the first time any energy company had allowed independent monitoring.

The Department of Energy study found that the chemicals and fluids used to crack open shale rock and extract gas remained 5,000 feet below any drinking water aquifers. (They did, however, find that the cracks could migrate as far as 1,900 feet up from the base of the well — farther than anyone had previously thought — but not enough to contaminate supplies.)

Does it matter where the leaks are coming from?

This is a key question.

How widespread is improper cementing? estimates vary

On the one hand, people with contaminated groundwater likely don't care how it happened. Their water is contaminated — and the well never would have been drilled in the first place if it weren't for fracking. (It's worth noting that methane-laced water isn't considered toxic, but it is flammable.)

The flip side, though, is that faulty wells might be easier to fix — say, by fixing the cementing or casing issues. "In our opinion," the PNAS study concludes, "optimizing well integrity is a critical, feasible, and cost-effective way to reduce problems with drinking- water contamination."

But there's no guarantee that all the faulty wells will actually get fixed. For starters, no one even knows how many oil and gas wells around the country might be poorly constructed. Some environmentalists say 10 to 15 percent of wells have improper cement sealing. Industry groups say the figure is closer to 1 percent.

It's also not entirely clear why there might be problems in the well's piping. Are many companies just in a hurry to drill and do a shoddy job with the cement? Or is there something about the wells themselves — say, the high pressure involved in fracking or the bends caused by horizontal drilling — that make them more susceptible to leaks?

And what about regulations? For the time being, rules on well construction still vary from state to state. Resources for the Future has assembled a helpful database of different state regulations on, for instance, cementing. Both Texas and Pennsylvania require specific types of cement to be used in well development. Oklahoma, by contrast, has no such regulations.

Meanwhile, the Environmental Protection Agency is currently conducting a study on groundwater contamination — but the federal government has been reluctant so far to intervene in water rules.