There are two types of replacement reactions, metal replacement and nonmetal replacement.
Metal replacement occurs when a more active metal replaces a less active metal in a compound. For example, when iron is added to a copper sulfate solution, the iron atoms replace the copper atoms in the solution, forming iron sulfate and copper metal.
$$Fe_{(s)}+CuSO_{4(aq)}\rightarrow FeSO_{4(aq)}+Cu_{(s)}$$
Nonmetal replacement occurs when a more reactive nonmetal replaces a less reactive nonmetal in a compound. For example, when chlorine gas is added to a solution of sodium iodide, the chlorine atoms replace the iodine atoms in the solution, forming sodium chloride and iodine gas.
$$Cl_{2(g)}+2NaI_{(aq)}\rightarrow NaCl_{(aq)}+I_{2(g)}$$
Replacement reactions can also be used to produce new compounds. For example, when hydrogen gas is added to a solution of copper oxide, the hydrogen atoms replace the oxygen atoms in the compound, forming copper metal and water.
$$H_{2(g)}+CuO_{(s)}\rightarrow Cu_{(s)}+H_2O_{(g)}$$
Replacement reactions are important in a variety of industrial processes, such as the production of steel, copper, and aluminum.