The electromigration (EM) of metallic lines is studied in terms of competition between two percolative processes taking place in a random resistor network. The effects associated with the transport of mass and with the consequent growth of the internal stress are accounted for by stochastic generation and recovery of voids, driven by the external current. Monte Carlo simulations enable us to investigate within a unified theoretical framework a variety of relevant aspects of EM degradation as: damage patterns, the distribution of the time to failures, early stage resistance change in the presence of compositional effects, Black's law, geometrical effects, etc. A general agreement is found with the experimental findings.