When there is excess of production of hydrochloric acid in our body, it causes acidity. An antacid tablet contains a base - milk of magnesia. We know that when an acid and a base are mixed the lead to neutralization. So when the base containing milk of magnesia comes in contact with the acid present in the stomach, the neutralization process occurs and thus, giving us relief.