Varnish and stain are both products that are applid to wooden surfaces. At its most basic, the difference between varnish and a stain is that a stain imparts an additional colour, literally "staining" the surface and grain of the wood into any of a wide variety of different shades.
A varnish is a transparent, hard, protective finish used to protect wood (and often other surfaces) from scratches. Varnish is generally glossy, but can be any of a number of different sheens, including satin, semigloss or matt. Varnish is often applied over wood stains as a final step. Varnishes can be resin based, acrylic, oil, polyurethane, water or epoxy based. Varnishes typically dry quite slowly unless applied in exceptionally thin coats, and most varnishes are highly flammable in their liquid state.
Stains are any of a variety of solvents used to impart pigment to the surface of wood. Wood stains can be either transparent or opaque. Stains are typically water, alcohol, wax, pigment or oil-based, with the main difference between the five being in the depth of colour achieved, effect on the grain and environmental impact. Water-based stains are considered more environmentally friendly, but also raise the grain of wood surfaces somewhat. Oil stains sink deeply into the grain, which can cause a patchy look in certain types of wood, and is generally considered the least environmentally friendly. Pigment stains are simply highly concentrated, finely ground pigments most often used to disguise the roughness of the grain of low-grade lumber. Alcohol stains are sold in powder form and are mixed into an alcohol solvent, and dry very quickly, penetrating only the surface of the grain making them most suited to spray applications. Wax-based stains are a combination of finishing wax and pigment, often best suited for pale pigments that do not need to penetrate deeply into the grain.
There are some products marketed as a combined stain and varnish, meant to speed the process of finishing furniture or to repair damaged finishes. Often the stains are mixed with a professional clear polyurethane. Because these products dry quickly, they may present a drawback by resting on the grain rather than sinking into it.
Thinned paints can serve much the same function as stains, and lacquers are similarly analogous to the function of varnishes, with the primary difference being that lacquers are typically sprayed on, rather than painted on.