Glass was first manufactured about 4,000 years ago in Mesopotamia as beads and a little later, small, beautifully colored vessels for holding scent and other luxury goods. It likely had nothing to do with sanitary concerns, and everything to do with making something that resembled semi-precious stones but was more malleable and less expensive.The earliest glass was made by pouring molten glass in molds. Later, it was made using what's called "core forming technique," in which a shape is made out of mud and dung. The shape is dipped in molten glass, decorative threads of glass and handles applied, and the neck and rim, worked. When it's cooled, the core is removed, and you have a lovely little perfume bottle.
As time went on and manufacturing techniques improved, glass vessels began to also be made for other purposes, primarily, ewers for pouring liquids (probably mostly wine) and cups to drink it with. It was still a luxury good, mostly core-formed or molded, and opaque.
By the first century BCE, glassworkers in Syria were figuring out how to use a hollow rod to blow into a blob of glass. Blowing a bubble of glass into a mold made it possible to produce lightweight glass with elaborate patterns and shapes thin enough to let light through.
But early translucent blown glass wasn't necessarily clear. The color of glass depends on the minerals present in the sand that is melted down to make the "metal," which is what glassblowers call the molten glass. To make transparent glass, you need high-purity silica sand, at least 90% silicon dioxide, with as little iron as possible. Even small amounts of iron in the sand produce glass with a blue or green tint.
By the 1st century BCE, glassworkers had figured out that adding antimony to the metal could de-color glass. Antimony reacts with iron in a way that prevents the iron from interfering with how lightwaves pass through, effectively decoloring the glass.
Blown glass was much cheaper to produce, and the Romans basically mass-produced glass in a wide variety of shapes, functions, and colors. They made a lot of transparent, or nearly transparent glass. The Romans understood that perfectly clear glass came from very specific kinds of sand. Glass during the Roman era became about as cheap as pottery and anyone could have at least a few glass cups, jars, or trinkets.
By the 3rd century CE, however, antimony stopped being used as a decolorant, and eventually, by the Middle Ages, lead oxide was used instead. Lead makes the glass softer and easier to work, but also masks iron to produce perfectly crystal-clear glass.
In Europe and America, lead was the main decolorant for centuries. By about the 1860s, Americans started using manganese dioxide, which had been used in various places since ancient times as a decolorant. Europeans kept using lead for longer. Fun fact: "sun purpled" antique glass happens when the manganse reacts with solar radiation and turns purple. (This is considered a defect and highly undesirable among serious collectors of 19th C American glass.)
WWI interfered with the manganese market (Germany was the main supplier for Europe and the US) so the glass industry on both continents shifted to using selenium, which is still one of the main decolorants used in the glass industry today. Boron is a decolorant that also produces heat-resistant "borosilicate" glass. Lead oxide is still used to produce glass with exceptional clarity and brilliance, and for high-quality cut glass. Point of fact: it's safe to drink from leaded glass but you shouldn't store food or wine in it because there's a chance lead could leach in over time. However, short contact is fine. Fill up your glass and drink it down!