"They were having problems with coffee that tasted good one day and not another," he explained to Business Insider. While that's a frustrating mystery for a coffee shop with exacting standards, "from a chemistry point of view, that's an interesting problem."

Specialty coffee shops can control where their beans come from and how they are roasted, ground, and brewed, but there's one crucial factor that can throw a wrench into the whole operation, Hendon found: the water.

To truly brew a perfect cup, it's not enough to know what kind of beans you're working with. You also have to know about the chemistry of the water.

What's In The Water?

Most people know that water can be "hard" (full of minerals like magnesium) or "soft" (most distilled water falls into this category). But there's also natural variation. Here's a map of the U.S. that shows how water hardness varies from place to place, although it can also vary over time: