Antacids work by neutralizing the acid produced in the stomach but don’t control the excess production of acid. Antihistamines are the drug that suppresses the action of histamine which is chemically responsible for the stimulation of secretion of HCl in the stomach.
They influence and prevent the binding of histamine with the receptors present in the stomach walls resulting in lower acid production and therefore provides better treatment.