Electrolysis is an overused and misused term when applied to copper tube. True electrolysis, or electrolytic corrosion, as it is more properly designated with regard to piping, is caused by an imposed (external) stray DC current and virtually ceased to occur with the disappearance of the trolley-car that was powered by high amperage DC current. In many cases, it is also thought that grounding of a building's electrical system to the copper piping can cause this phenomenon, but there is no statistical data to support this, nor is it recommended that the piping system be used as the main electrical ground for a building or dwelling.
Usually, what people are really referring to when they say electrolysis is galvanic or dissimilar metal corrosion. Galvanic corrosion is caused by self-induced current created by electrical potential of two dissimilar metals in contact with an electrolyte. It can occur when two dissimilar metals (such as copper tube and steel pipe) are connected in the presence of an electrolyte.
Fresh potable water is a weak electrolyte. Salt water or acid solutions are good electrolytes, hence the use of an acid solution in an automotive battery. Furthermore, based on common metal piping materials and how they react to each other, it is rarely the copper tube that fails because of galvanic corrosion. This and the entire phenomenon of dissimilar metal corrosion as described in the context of a steel pipe fire sprinkler system is further explored in Corrosion of Mixed Metal Fire Sprinkler Systems white paper.