Why do German mugs have lids?
The lid. The lids on beer mugs serve as a sanitary measure, especially to keep insects out of the beer. They are usually made out of pewter, and are usually equipped with a lever that is in reach of the thumb, so that it is possible to grab the mug and open and close the lid with a single hand.
The lid helps to keep water hot and leaves will sink to the bottom of mug.
If it's made in Germany, odds are your stein is special. Investigate the bottom of the glass. Look for “Made in Germany” or “Gemacht in Deutschland.” Obviously if it has a “Made in” mark but the country isn't Germany, you don't have an authentic German beer stein.
The Origin of Steins: Steins originated in the 14th century. As a result of the bubonic plague and several invasions of flies in Europe, Germany established laws to require beverage containers to be covered for sanitary purposes.
In common usage, stein refers to any beer container with a hinged lid and handle, although the word is often replaced with krug, seidel, or humpen in German. You may also come across people who use the word tankard to refer to only the all-silver and pewter steins.