When a metal reacts, its atoms lose electrons to form positive ions. The more reactive a metal, the greater its tendency to form a positive ion, so the more easily it loses electrons. This is why reactive metals react more vigorously.
With cold water, potassium reacts violently, sodium reacts very fast and calcium reacts steadily, all giving a metal hydroxide and hydrogen: 2Na + 2H2O → 2NaOH + H2. Magnesium reacts only very slowly with cold water. In the practical, the faster the bubbles of hydrogen are given off, the more reactive the metal.
With dilute hydrochloric acid, a metal reacts to form a salt and hydrogen gas. Magnesium reacts quickly to form magnesium chloride and hydrogen: Mg + 2HCl → MgCl2 + H2. Zinc reacts more slowly and iron more slowly still. Copper does not react because it has a low tendency to form positive ions. The order of reactivity of these metals is therefore magnesium, zinc, iron, copper.