In a displacement reaction, a metal reacts with a metal compound. Take copper sulphate and iron. Copper sulphate is composed of copper ions and sulphate ions bonded by the attraction between their opposite charges. Pure iron is made up of iron atoms (sort of).
When iron displaces the copper to form iron sulphate and copper, the copper ions in the sulphate gain elections to become atoms, and together become pure copper. The iron atoms lose electrons, becoming ions, which are then attracted to the opposite charge of the sulphate irons, bonding to form iron sulphate.