  Nucleonic matter displays a quantum liquid structure, but in some cases
finite nuclei behave like molecules composed of clusters of protons and
neutrons. Clustering is a recurrent feature in light nuclei, from beryllium to
nickel. For instance, in $^{12}$C the Hoyle state, crucial for stellar
nucleosynthesis, can be described as a nuclear molecule consisting of three
alpha-particles. The mechanism of cluster formation, however, has not yet been
fully understood. We show that the origin of clustering can be traced back to
the depth of the confining nuclear potential. By employing the theoretical
framework of energy density functionals that encompasses both cluster and
quantum liquid-drop aspects of nuclei, it is shown that the depth of the
potential determines the energy spacings between single-nucleon orbitals, the
localization of the corresponding wave functions and, therefore, the degree of
nucleonic density clustering. Relativistic functionals, in particular, are
characterized by deep single-nucleon potentials. When compared to
non-relativistic functionals that yield similar ground-state properties
(binding energy, deformation, radii), they predict the occurrence of much more
pronounced cluster structures. More generally, clustering is considered as a
transitional phenomenon between crystalline and quantum liquid phases of
fermionic systems.
