The quantum substructure of gravity