To start with I will explain how an electric guitar amp works. As you pluck a string on a guitar it vibrates. The pickups in an electric guitar are nothing more than a bar magnet with many coils of string wrapped around it (an electromagnet), much like a generator this electromagnet takes the kinetic energy of the vibrating strings and turns it into electrical energy which goes through some wires out of the guitar into the amp. In the amp signal the energy is again changed from electrical into kinetic in the form of a speaker moving back and forward creating vibrations in the air, we hear this as sound. By tightening the strings and changing the length of them (tuning and placing your finger on a fret) we get different vibrations that create different electrical signals and therefore different sounds.
As you turn up the volume on a guitar amp you are increasing the amplitude of the sound wave but amps have something that is known as a threshold. A threshold is the point where the amp is trying to output a sound wave of greater amplitude than it is capable of. The result of this is something known as distortion. What happens when trying to output a wave of greater amplitude than the threshold is that it gets clipped, that is the peaks and troughs get cut and form a wave with a flat at it’s peaks and troughs not a point. These flat sections are the distortion.
Originally distortion wasn’t intended but as rock musicians started playing louder and louder the early amps couldn’t handle the volume and gave this effect that has now become an integral part of rock music. One of the earliest recorded examples of distortion was ‘Rocket 88 by Ike Turner and the Kings of Rhythm’ in 1951 where guitarist Willie Kizart used a damaged amp that meant its threshold was lowered further than usual. By the mid-late 1950s guitarists began doctoring amps so increase distortion as a deliberate effect. By the 1970s we had bands such as Deep Purple and Black Sabbath using this effect so effectively that it is now as popular as it is today.