It neutralizes excess stomach acid or hydrochloric acid. The hydroxide ions of the milk combine with the hydrogen ions in the stomach acid to reduce excess acidity in the stomach. The magnesium ions in the milk of magnesia withdraw water from the surrounding tissues via osmosis.