About 50 years ago, J.D. Bernal introduced the idea that random assemblies of spheres represent a valuable model to understand the liquid state. Connections between purely geometric approaches (how to pack particles in three dimensions?), and statistical mechanics theories of the liquid state (how to describe dense fluids?) are still actively sought. In this talk, I will discuss a variety of phase transitions occuring when random configurations of spheres are compressed, described as 'glass' or 'jamming' transitions for thermal and athermal systems, respectively, and the unexpected connections between them. Mean-field analysis and three-dimensional numerical work show that the physics of amorphous solids teaches useful lessons to understand the packing problem, showing that Bernal's insight also works backwards.