Thank you for the excellent question. Because of the cosmic expansion, there is a competition between gravity and motion (binding energy versus kinetic energy). A rocket escapes from the gravitational pull of the Earth if it is faster than the escape speed of 11.2 kilometers per second. Gravity wins in the context of the Universe if the density within a spherical region is above a critical value relative to the Hubble expansion rate.