The stomach maintains an acidic pH primarily through hydrochloric acid (HCl) secretion from parietal cells in the gastric glands. This acidic environment (pH 1.5-2) is essential for activating digestive enzymes and killing ingested pathogens. Mucus secretion (option A) protects the stomach lining, while bile (B) and pancreatic juice (C) are secreted into the small intestine, not the stomach.