Alan’s post is excellent. Thank you Alan for a clear and entertaining overview of such a complex topic.
I’ll add some more wine-specific analytical chemistry details here, including a couple things that conflict with parts of Alan’s (generally great!) post.
TA = Titratable Acidity
It’s with good reason that the two professionally trained chemists who’ve commented on this post so far both mentioned how irritating/confusing the term “total acidity” is. Let me be very clear here: the term “total acidity” is not used by anyone in the wine industry except as an error/misunderstanding (with a few niche exceptions). Annoyingly, “total” and “titratable” both begin with a “t”, so when we talk about “TA” people understandably get confused. In general, 99% of the time you hear someone say “total acidity” in a wine, they actually mean “titratable acidity”. Yes, this includes on wine labels, in marketing material, and on some supposedly educational websites. “Total acidity” is actually an important concept in the abyssal depths of nerdy wine chemistry but I think it should be separated from this discussion for the sake of clarity.
But what is Titratable Acidity?
Titratable acidity (“TA”) can be thought of as a measure of the “effective acidity” of a wine. First, I will explain what TA is and how we measure it, then we can go on to how this relates to sensory experience and pH.
Remembering from Alan’s post that acids are compounds that can release, or “donate” a proton (a.k.a. hydrogen ion), each acid in wine exists in multiple forms: some of the molecules will have their donatable hydrogen(s) attached, others will not (this is a simplification but the general point is true). The ratio of these forms depends on the pH of the wine, which is determined by the overall chemistry of the mixture.
To measure TA, we perform a titration! We add a strong base (sodium hydroxide), which essentially gobbles up all of the available protons it can. As you add the base, first the most easily donated protons are released from the acids and consumed by the base*. As you add more and more base, less easily donated protons start to be donated. As you add the base and it takes away these protons, the pH of the mixture increases (because there are fewer free protons around!), but the extent to which the pH rises as you add the base is dependent on how much of each acid you have, and how strong each of those acids is. We keep adding the base until we get to a specific pH (usually 8.2). Then, to calculate TA, we take the amount of base we added and use a conversion factor that basically says, “if all of the acid was tartaric acid, how much would react with this amount of base to take the wine from its original pH to 8.2?” This is why TA is reported as “tartaric acid equivalents”. It’s a handy convention to account for the fact that acidity in wine comes from roughly 6-10 important acids, depending on the wine. I think in France they traditionally refer to TA in sulfuric acid equivalents…so be aware of that if you’re comparing numbers to those originating in Europe - they’ll look quite strange.
How are pH and TA related?
To a first approximation, high TA should = low pH, and in general it is true that wines with lower pH tend to have higher TA, and vice versa. However, we’ve got to bear in mind that wines are, chemically speaking…SO COMPLICATED. I’m actually not going to go into the details of how the other components in wine - and some winemaking processes - can obscure the relationship between pH and TA, partly because I’m mid-harvest so my brain is a bit mushy, and partly because I really don’t fully understand it myself and I would rather be brief (hah) than give people incorrect information.
What I will say is that a huge variety of factors are at play here. It is hard to overstate the complexity of wine as a matrix. Potassium plays a really important role in modulating pH and TA in wine, but it’s only one (important) component, and there are a lot of others. Among the inorganic cations, calcium, sodium, and magnesium may all be important in certain circumstances, and that is just barely scratching the surface. Anyone who tells you they know the answer probably doesn’t, though they may have interesting things to contribute to the conversation.
What are the relevance of pH and TA to wine’s sensory characteristics?
pH is not well correlated with people’s perception of acidity in wine. However, TA is very well correlated: higher TA = higher perceived acidity. You can, in both theory and practice, have a Cabernet Sauvignon at pH 3.9 that tastes more acidic than a Pinot Noir at pH 3.4. Having said that, one area of wine chemistry that is, in my mind, woefully understudied - at least from what I’ve read - is in characterizing types of perceived acidity. If you have three wines with similar TA, residual sugar, alcohol, and acid profiles, why does one taste “juicy” while another tastes “sour” and the third tastes “zingy”? I think this is the kind of thing Nick Jackson was trying to get at. Sometimes spatial analogy is more helpful than chemistry. We can’t measure EVERYTHING.
pH does have an impact on the color of red wines because anthocyanin speciation is pH-dependent. Lower-pH wines will generally be brighter red, while higher-pH wines may be more purple or blueish (don’t read too deeply into this though, because color is also dependent on the populations of different anthocyanins, which varies across grape varieties). TA is not relevant to this.
pH, TA, and the relationship between the two, have quite a number of important implications for both viticultural and winemaking processes, but that’s getting a bit out of my wheelhouse so I will let the actual viticulturists and winemakers on this board talk about that while I scurry back into my lab 
*In the case of titrating with sodium hydroxide, the reaction can be thought of as sodium hydroxide + tartaric acid → sodium tartrate(aqueous) + water). A similar titration happens during red winemaking, as potassium released from the skins reacts with tartaric acid in the liquid, leading to an increase in pH/decrease in TA and, ultimately, saturating the wine with potassium hydrogen tartrate, which then gives us our beloved(?) tartrate crystals. The effect of this crystallization on the pH depends on the starting pH of the wine, but it will always decrease TA…this is one of the things that can give you variation in TA vs. pH.