Acid is needed by the body but too much or too little or in the wrong place can cause problems.
Hydrochloric acid is produced by the stomach to aid digestion and combat harmful bacteria. It should remain in the stomach and the quantity and strength varies depending upon need.
This acid is dangerous stuff: it's strong enough to dissolve metal. If you were to spill it on your skin, it would burn and cause scarring. The stomach is protected by being lined with special cells that constantly produce a layer of mucous to prevent acid attack.
The acid helps turn the food bolus entering the stomach from the oesophagus into liquid chyme and leaches essential minerals from the food for better absorption in the intestines.
Another important role of the acid is in protection against disease as it can kill harmful ingested bacteria.
The amount and strength of acid in the stomach is controlled by the food and expectation of it through hormonal signals from the thyroid gland. The production of acid also triggers production of pepsin and other enzymes which help break down proteins.
If the stomach produces too much acid (hyperchlorhydria), the mucous may be insufficient to protect the stomach lining. Inflammation (gastritis) or ulcers can form.
Whether stress can cause too much acid is a matter of debate. Anecdotally, many who suffer with excess stomach acid report it having been exacerbated by stress which could be due to reduced levels of a protein called TFF2 which helps repair acid damage. [a-ii]
Too little stomach acid (hypochlorhydria) can resut in poor absorption of essential elements and reduced bacterial immunity.
Many people have the bacteria H-Pylori (helicobacter-pylori) living in their gut. For some people this can be the cause of stomach ulcers. They do not like an acid environment and burrow deep into the stomach walls where acid levels are more neutral. [a-iii]
H-Pylori is treated with a mixture of antibiotics.
Keeping it in its place.
From the stomach, the liquid chyme flows out through the pyloric sphincter into the duodenum and intestines. It may still be acidic though may be partially neutralised by the bile it encounters in the duodenum. The columnar structure of the cells lining the intestines, along with more mucous, makes them resistant to acid.
The top of the stomach is held shut by muscles collectively known as the Lower Oesophageal Sphincter to prevent the possibility of the acid splashing back into the oesophagus.