When cooled or pressurized, polymer melts exhibit a tremendous reduction in molecular mobility. If the process is performed at a constant rate, the structural relaxation time of the liquid eventually exceeds the time allowed for equilibration. This brings the system out of equilibrium, and the liquid is operationally defined as a glass - a solid lacking long-range order. Despite almost 100 years of research on the (liquid/)glass transition, it is not yet clear which molecular mechanisms are responsible for the unique slow-down in molecular dynamics. In this review, we first introduce the reader to experimental methodologies, theories, and simulations of glassy polymer dynamics and vitrification. We then analyse the impact of connectivity, structure, and chain environment on molecular motion at the length scale of a few monomers, as well as how macromolecular architecture affects the glass transition of non-linear polymers. We then discuss a revised picture of nanoconfinement, going beyond a simple picture based on interfacial interactions and surface/volume ratio. Analysis of a large body of experimental evidence, results from molecular simulations, and predictions from theory supports, instead, a more complex framework where other parameters are relevant. We focus discussion specifically on local order, free volume, irreversible chain adsorption, the Debye-Waller factor of confined and confining media, chain rigidity, and the absolute value of the vitrification temperature. We end by highlighting the molecular origin of distributions in relaxation times and glass transition temperatures which exceed, by far, the size of a chain. Fast relaxation modes, almost universally present at the free surface between polymer and air, are also remarked upon. These modes relax at rates far larger than those characteristic of glassy dynamics in bulk. We speculate on how these may be a signature of unique relaxation processes occurring in confined or heterogeneous polymeric systems.