Mezcal is a distilled product of the agave plant family. There are over 30 varieties of agave that can be used. Tequila uses a specific one, the weber blue agave. It also comes from a specific area in Mexico. Mezcal can be made from several different species of agave and is usually made in the Oaxaca area of Mexico. Tequila is a form of mezcal that is rather specialized and is distingushed from other mezcals for the most part because of the unsavory reputation mezcal had for years.
A basic analogy is the differences between cognac and armagnac. Mezcal is the country cousin, much less well known, earthier and in it's case much more traditional in its preparation than tequila ( which again is a form of mezcal).
The 'worm' by the way is actually a butterfly larvae (read catapillar) and is not present in Tequila.
Also a new trend is to replace the 'worm' with a scorpion. Look for my upcoming reviews or mescals at spiritsreview.com