Ph is based on the excess of either hydrogen or oxygen bonds in water. The more hydrogen the more H3O+ and the more oxygen the more OH-. Hydrogen swings the aqueous solution to acid and oxygen swings it to alkali. Hydrocloric acid contains lots of hydrogen and bleach contains more oxygen making it akaline.
Fertilizers adjust the ph also in this manner with certain elements being acidic and others alkaline giving an overall end ph of their averages.
This is just as i understand it but welcome someone pointing out anything i may be wrong over.
I own a tds ph meter but that led me to the conclusion that my waters fine and my soil deals with any ph fluctuations. It just collects dust in the cupboard now.