Gastric acid
The main constituent of gastric acid is hydrochloric acid which is produced by parietal cells (also called oxyntic cells) in the gastric glands in the stomach. Its secretion is a complex and relatively energetically expensive process. Parietal cells contain an extensive secretory network (called canaliculi) from which the hydrochloric acid is secreted into the lumen of the stomach. The pH of gastric acid is 1.5 to 3.5 in the human stomach lumen, the acidity being maintained by the proton pump H/K ATPase. The parietal cell releases bicarbonate into the bloodstream in the process, which causes a temporary rise of pH in the blood, known as an alkaline tide.
Mucus
The ionic charges of mucin are mainly provided by acidic amino acids including aspartic acid (pKa=3.9) and glutamic acid (pKa=4.2). The charges of acidic amino acids will change with environmental pH value due to acid dissociation and association. Aspartic acid, for example, has a negative side chain when the pH value is above 3.9, while a neutrally charged side chain will be introduced as pH value drops below 3.9. Thus, the number of negative charges in mucus is influenced by the pH value of surrounding environment. That is, the polyelectrolyte effect of mucus is largely affected by the pH value of solution due to the charge variation of acidic amino acid residues on the mucin backbone. For instance, the charged residue on mucin is protonated at a normal pH value of the stomach, approximately pH 2. In this case, there is scarcely polyelectrolyte effect, thereby causing compact mucus with little swelling capacity. However, a kind of bacteria, "Helicobacter pylori", is prone to producing base to elevate the pH value in stomach, leading to the deprotonation of aspartic acids and glutamic acids, i.e., from neutral to negative-charged. The negative charges in the mucus greatly increase, thus inducing the polyelectrolyte effect and the swelling of the mucus. This swelling effect increases the pore size of the mucus and decreases mucus' viscosity, which allows bacteria to penetrate and migrate into the mucus and cause disease.