In the reaction we gives the magnesium chloride and released hydrogen gas.
The reaction is carried out by contaning positive and negative charged on elements as follows
Mg + HCl --->MgCl2 + H2
Net reaction gives
Mg+ + 2Cl- + 2H+---> Mg+² + 2Cl- + 2H
Check it Mg(s) and Mg2+ not equal . The donor is element while the acceptor is an ion. The same process is done for H2 (g) and H+.