We review a recently proposed theory of random packings. We describe the volume fluctuations in jammed matter through a volume function, amenable to analytical and numerical calculations. We combine an extended statistical mechanics approach 'a la Edwards' (where the role traditionally played by the energy and temperature in thermal systems is substituted by the volume and compactivity) with a constraint on mechanical stability imposed by the isostatic condition. We show how such approaches can bring results that can be compared to experiments and allow for an exploitation of the statistical mechanics framework. The key result is the use of a relation between the local Voronoi volume of the constituent grains and the number of neighbors in contact that permits a simple combination of the two approaches to develop a theory of random packings. We predict the density of random loose packing (RLP) and random close packing (RCP) in close agreement with experiments and develop a phase diagram of jammed matter that provides a unifying view of the disordered hard sphere packing problem and further shedding light on a diverse spectrum of data, including the RLP state. Theoretical results are well reproduced by numerical simulations that confirm the essential role played by friction in determining both the RLP and RCP limits. Finally we present an extended discussion on the existence of geometrical and mechanical coordination numbers and how to measure both quantities in experiments and computer simulations.