Metallic oxides are basic nature because the oxides of metals such as MgO or CaO or Na2O form hydroxides in their aqueous solutions. For example:
K2O+H2O→2KOH|K2O+H2O
MgO+H2O→Mg(OH)2|MgO+H2O→Mg(OH)2
Metal oxides like CaO and Na2O react with water and give hydroxides:
CaO+H2O→Ca(OH)2
Na2O+H2O→2NaOH
While non-metal oxides like CO2 and SO2 react with water and give acids:
CO2+H2O→H2CO3→H++HCO3
SO2+H2O→H2SO3→H++HSO3