A drink brewed from the same leaves or beans can taste markedly different in two cities. Since the water forms almost all of the finished cup, its composition is doing a great deal of the work.
Brewing is an extraction, and water is the solvent
Hot water dissolves acids, sugars, aromatic compounds and bitter substances out of the leaf or ground bean over a short period.
How much of each is extracted depends on temperature, time and on what is already dissolved in the water before it starts.
Water with minerals already in solution therefore behaves as a different solvent from water without them, and extracts a different balance of compounds.
Minerals bind selectively to flavour compounds
Magnesium and calcium ions in hard water attach to particular flavour molecules and help pull them out of the grounds or leaves.
They favour some compounds over others, so hard water does not simply extract more, it extracts a different profile with certain notes emphasised.
This is why a coffee described as fruity can taste flat and heavy in one place and bright in another with no change to the beans or the method.
Alkalinity neutralises the acids that make a drink lively
Water containing carbonates resists changes in acidity, and it neutralises some of the acids extracted during brewing.
The result tastes duller and rounder, since the acidity that would have given the cup definition has been chemically removed.
Very low alkalinity does the opposite and lets acidity dominate, which can make the same brew taste sharp and thin.
Fully purified water is not the answer
Water with almost nothing dissolved in it extracts poorly, because the mineral ions that assist extraction are absent.
Drinks made this way tend to taste hollow, with aroma present but body missing, which is a common surprise for anyone who assumes purity is the goal.
Brewing water is therefore a target range rather than a minimum, and this is why specialist users add measured mineral content back into purified water.
Tea is more visibly affected than coffee
Tea contains compounds that react with dissolved metals and carbonates to form a surface film and to darken the liquid.
The same tea brewed in softer water stays clearer and brighter, which is why identical leaves produce visibly different cups in different regions.
Adding milk masks much of this, which is part of why tea traditions in hard water areas so often include it as standard.