By replanting vegetation on a mine it will prevent acid mine drainage because it:
prevents mine materials to be exposed to oxygen;
flowing/percolating water;
otherwise prevent bacteria from catalyzing the necessary reactions.
Some plants are added there to reduce the acidity, which causes metals to precipitate out of the contaminated water.