Hydrochloric acid is secreted by the glands present on the stomach walls. It dissolves bits of food and creates an acidic medium. The acidic medium allows pepsinogen to be converted into pepsin. Pepsin plays an important role in the digestion of proteins. Therefore, if HCl were not secreted in the stomach, then pepsin would not be activated. This would affect protein digestion. A pH of about 1.8 is necessary for proteins to be digested. This pH is achieved by HCl.