I don't know if you still need this, but i need some points so whatever lol
The answer is that Objects with more mass have more gravity. Gravity also gets weaker with distance. So, the closer objects are to each other, the stronger their gravitational pull is. Earth's gravity comes from all its mass.