Acids are used to balance acidity in your wine, adjust the pH of your mash, or to create sour ales. If used in brewing it is best to acidify the sparge water and not only the mash. This will keep pH lower even during the end of the sparge thus minimizing tannin extraction from the grains. Lactic acid can be dosed directly into fermented beer to quickly and easily create styles like the Berliner Weisse and Gose without the fuss of controlling bacteria or a sour mash.
Water treatment adjusts pH and mineral levels. We are lucky here in Charleston to have much better base brewing water than much of the country. It's easy to add to the modest ion concentrations in our water. In brewing the largest emphasis is on mash pH however once that is obtained many prefer to adjust things like chloride-to-sulphate ratios. Many people reproduce the water chemistry from certain areas of the world.
Not into getting that "nerdy" with your water chemistry? pH stabilizer is a product that takes all the work out of it. Just add it to the mash and let it do its thing!