Glasses are disordered materials that lack the periodicity of crystals but behave mechanically like solids. The most common way of making a glass is by cooling a viscous liquid fast enough to avoid crystallization. Although this route to the vitreous state-supercooling-has been known for millennia, the molecular processes by which liquids acquire amorphous rigidity upon cooling are not fully understood. Here we discuss current theoretical knowledge of the manner in which intermolecular forces give rise to complex behaviour in supercooled liquids and glasses. An intriguing aspect of this behaviour is the apparent connection between dynamics and thermodynamics. The multidimensional potential energy surface as a function of particle coordinates (the energy landscape) offers a convenient viewpoint for the analysis and interpretation of supercooling and glass-formation phenomena. That much of this analysis is at present largely qualitative reflects the fact that precise computations of how viscous liquids sample their landscape have become possible only recently.