The type of reaction that happens with iron metal shavings when added to hydrochloric acid is called a single displacement reaction. It is a reaction wherein an single atom replaces or displaces an atom in a compound. A single replacement reaction would have a general chemical equation as
A + BC = AC + B
The chemical reaction for the reactants given would be:
Fe + 2HCl = FeCl2 + H2
As you can see, the hydrogen atom is released from the compound by the iron metal. This happens because iron atoms are much more reactive than hydrogen. It has the necessary amount of energy for it to displace the hydrogen atoms.