The process of depositing a layer of any desired metal on another material, by means of electricity, is known as electroplating.
Tin is less reactive than iron. Tin coating prevents food from coming in contact with iron. Thus prevents it from getting spoilt.