For example, the force of gravity between two objects that are 1 meter apart is four times stronger than the force of gravity between the same two objects that are 2 meters apart. This is because the distance between the objects is doubled, so the force of gravity is reduced by a factor of 4 (2²).
In space, the distances between objects are often much greater than they are on Earth. For example, the distance between the Earth and the Moon is about 384,400 kilometers. This means that the force of gravity between the Earth and the Moon is about 384,400² times weaker than the force of gravity between two objects that are 1 meter apart on Earth.
Despite being much weaker, gravitational force is still present in space and it is responsible for keeping planets in orbit around the Sun, moons in orbit around planets, and stars in orbit around galaxies.