It is used for protecting inner tank from corrosion, normally, after 2 years replace a new magnesium rod due to consumption.
Haier water heater with a big magnesium anode rod, it weight reach more than 310g, and special wires connection design, so it can protect inner tank for a long life.