Water might be the most varied chemical compound on the planet. Plain old H2O is the same anywhere, of course. But brewing with pure water is not only expensive, but leads to poor beer - flat, stale and downright incorrect.
Why Water Matters
That's because the dozen or more elements or compounds found in natural sources contribute greatly to the final product. Two of the major elements are Ca, calcium and Mg, magnesium. These two add the 'hardness' in hard water. Undesirable when they cause your glasses to spot in the dishwasher, they're indispensable when making a fine beer. Not only do they add a desirable mouthfeel of their own, but they aid many of the bio-chemical processes taking place during brewing.
Ca, for example, helps produce an acid that balances the alkaline phosphates found in malts. Control of that pH (a measure of acidity/alkalinity) is vital for the activity of enzymes that take part in the brewing process.
Mg is essential because it's used by yeast in the production of enzymes required for fermentation. But, as luck would have it, Mg can compete with Ca and so its concentration has to be carefully controlled for proper results. Also, above about 20 mgs/l (milligrams per liter), it can make the beer bitter or sour.
Not all naturally occurring or artificially added components are desirable. Chlorine, Cl, for example helps keep bacteria from building up in commercial water supplies. But it adds a bitter taste and can contribute to killing yeast. Fortunately, it's volatile and easily removed by boiling or carbon filtration.
Sodium, Na, contributes a salty taste (it's half of table salt, NaCl), but at a too high concentration it can kill yeast. Most natural sources contain a reasonable amount, but control of salinity at sites near a sea-river conjunction is important.
Even trace elements, such as Zinc (Zn) and Copper (Cu) play an important role in many brewing processes, since they figure prominently in yeast metabolism. It's the yeast that turns malt sugar into alcohol and carbon dioxide during fermentation. High levels can contribute to haze, though.
More complex compounds play a part, as well.
Sulfates, SO4, give a dry, sharp flavor and can compliment hops. British ales make frequent use of this feature. But in too high concentration it can be excessively bitter.
Carbonates, CO3, promote the extraction of tannins from hops and grains. Barley is a grain and goes into making malt sugar, used in fermentation. They help promote darker colors in some beers and provide alkalinity to balance the acids.
Levels of these elements and compounds vary naturally throughout the world.
Pilsen, for example, has very soft water and produces a very mild lager in most cases. The lagers from Munich, by contrast, are delightful in part because of the hard water used by brew meisters there for centuries. Dortmund, home to a famous lager style, has very hard water with high levels of most minerals found in water.
Ales from Burton-on-Trent in England similarly benefit from the hard water in that locale. The high carbonate levels in Dublin, where some excellent stouts are produced, require balancing with acidic dark malts.
There are over 800 compounds in beer (some studies suggest over 1,000 and the list is growing), but a dozen or so found in water are significant factors in the final product. Not to mention the H2O itself. Beer is 90% water.