Because the reaction produces hydrogen gas.
Magnesium metal will react with hydrochloric acid to produce aqueous magnesium chloride,
#"Mg"_ ((s)) + 2"HCl"_ ((aq)) -> "MgCl"_ (2(aq)) + "H"_ (2(g)) uarr#
The hydrogen gas produced by the reaction will bubble out of the solution--this is what the up arrow added next to
So it's not the magnesium metal itself that fizzles and bubbles, it's the hydrogen gas produced by the reaction.