The function of mordant in the gram staining is to expose grams positive cell to the decolorizer which dissolves the lipids in the cell wall thus allowing the crystals violent-iodine to leach out of the cell. This facilitate the cell subsequently be stained by with safranin.
In the context of multivalent ions, it is when it has multiple oxidative states.