The inside of a stomach is coated with a lining that protects it. This lining is made up of cells called epithelial cells. They coat the stomach with a mucus that neutralizes the acid.
The mucus contains bi-carbonate (a base), similar to baking soda. Acid + Base = water and salt So, that’s why taking tums or swallowing baking soda water helps an upset stomach.
When your stomach is upset, it means there’s too much acid. Taking a tums neutralizes that overproduction eating also helps to absorb the excess acid.