Stomuch secretes hcl helps to digest food. Food lasts in stomach for about 3 hr after our meal. That's why we should not sleep within 3 hr after meal and thus it act as reservoir of food. It also secrete intrinsic factor which help to absorb vit B12. The acidic ph of stomach kill many bacteria. Person taking antacid or PPI are at high risk of getting GI infectioms.