Sodium hydroxide is an ionic compound and it just dissolves in water.
NaOH(s) + water Na+(aq) + OH¯(aq)
Ammonia and the carbonate ion are weak bases, just a small fraction of the species reacting by proton transfer from water:
NH3(aq) + H2O NH4+(aq) + OH¯(aq)
CO32¯(aq) + H2O HCO3¯(aq) + OH¯(aq)