Sodium hydrogen carbonate is an amphiprotic substance, meaning it can act as both a proton donor and proton acceptor (acid or base).
NaHCO3 + HCl -> NaCl + H2CO3
This carbonic acid readily dissolves into carbon dioxide and water.
NaHCO3 + NaOH -> Na2CO3 + H2O