The reaction between hydrochloric acid (HCl) and magnesium metal (Mg) produces magnesium chloride (MgCl₂) and hydrogen gas (H₂).
Equation:
$$2HCl + Mg → MgCl₂ + H₂$$
Hydrogen is a highly flammable gas, so when it comes into contact with a flame, it ignites, producing a small explosion and a popping sound.