Spatial scaling laws yield a synthetic theory of biodiversity