Gravity is a force pulling together all matter. The more matter, the more gravity, so things that have a lot of matter such as planets or moons pull stronger.
Gravity pulls us to the Earth every day, and we pull back. Our gravity is equal to Earth's, but we can't move Earth. However, Earth can move us because it is so much more massive.
An object with a lot of mass goes forward and wants to keep going forward; however, the gravity of another body in space pulls it in. There is a continuous tug-of-war between the one object wanting to go forward and away and the other wanting to pull it in.