The short version
Glass is mostly sand, melted with soda ash and limestone and cooled before its atoms can line up into crystals. The result is a hard, disordered solid that lets visible light through because its electrons cannot absorb it. Almost all flat glass today is made by floating molten glass on a bath of molten tin, then cooling it with great care. How it is cooled decides whether it is ordinary, stress-free glass or toughened safety glass.
How it works
Ordinary soda-lime glass is roughly 72% silica, 14% sodium oxide and 10% calcium oxide, with small amounts of magnesium and aluminium oxides. Silica forms a three-dimensional network of silicon atoms each bonded to four oxygens. In quartz that network repeats perfectly; in glass it is random beyond a few atoms. Sodium ions break some links in the network, which lowers the melting temperature; calcium makes the result durable in water.
Glass is defined less by composition than by history. Cool almost any melt fast enough and it becomes a glass: its viscosity climbs so steeply that, below the glass transition (about 550 °C here), the structure is frozen. Above that, glass softens gradually rather than melting at a single temperature, which is the property every glassmaker exploits.
It is transparent for two reasons. First, the electrons in silica need ultraviolet energies, roughly 9 eV, to be excited, while visible photons carry only about 1.8–3.1 eV, so they are not absorbed. Second, with no crystal grains there are no internal boundaries to scatter light, unlike a pile of sand or a sugar cube. The green tint seen through the edge of a pane is iron, an impurity in the sand; "low-iron" glass for solar panels and display cases removes most of it.
About 4% of light reflects at each air–glass surface, set by the refractive index of about 1.5, so a clear single pane passes about 92%.
How it's made
The batch. Silica sand, soda ash (sodium carbonate), limestone and dolomite are weighed and mixed with cullet, crushed recycled glass. In the furnace the carbonates decompose, releasing carbon dioxide, and the mix melts at about 1,500 °C. Bubbles must rise out of the melt (fining) before it is used.
Float glass. The melt pours onto a bath of molten tin several metres wide. Tin is denser than glass, does not mix with it, and has a perfectly flat surface. The glass spreads until gravity and surface tension balance at about 6 mm thick; edge rollers pull it thinner or hold it thicker, from under 1 mm to over 20 mm. The bath atmosphere is nitrogen with a little hydrogen to stop the tin oxidising. The ribbon enters at about 1,100 °C and leaves at about 600 °C. A float line runs non-stop for years, since stopping the furnace risks damaging it.
The ribbon passes through a long tunnel oven, the , which lowers its temperature slowly through the glass transition so that no stress is frozen in. Unannealed glass can crack spontaneously or when cut.