Why do elephants have ivory tusks?

Iron ones would rust. :)