Note: I have not used Zegerid. It does show that there is a significant effect of baking soda on stomach acid.
Summary. Baking soda and water alleviates heartburn. By the time you use an antacid, some level of damage may already have occurred to your body. Baking soda can provide somewhat slower but more thorough relief to heartburn flare-ups.
And: Baking soda can salvage days that would otherwise be painful. But medical attention may be needed in frequent heartburn.