Gravity is a force of attraction that exists between all objects that have mass.
The amount of attraction between two objects with mass is based on how large the objects are and how far they are away from one another.
The moon orbits the earth due to the force of attraction that is created by the mass of the earth. Without the mass of the earth, the moon would be traveling in a straight line through outer space.
The mass of the sun is so great that its gravity causes all celestial bodies in the solar system to orbit it.
On earth, we can see gravity at work when we drop a pencil. The mass of the earth is so great that all of the objects on the planet are held closely to its surface.