The role of gravity in the planetary motion
Gravity is what holds planets in orbit around the sun and what keeps the moon in orbit around Earth.
Newton proposed that the planets are in free fall towards the Sun just as every terrestrial object is in free fall towards the center of Earth! Then why aren't planets crashing into the sun?
Newton corroborated this notion with a thought experiment. He imagined a cannon on top of a very high mountain. When the cannon fires, if there were no gravity, the cannonball would go in a straight line forever. However, gravity curves the cannonball’s path, making it accelerate downwards until it eventually hits the ground. The faster the cannonball is fired, the more distance it travels before hitting the ground. If the cannonball is fast enough, it could travel all the way around the earth and settle into orbit. This orbit is a balancing act between the cannonball's tendency to fly off in a straight line and its being pulled back towards the center of the earth continuously by the force of gravity. The same story applies to the planets in orbit around the sun: they are continuously falling towards the sun but never hitting it.
The centripetal force
When an object moves in uniform motion in a circle, the module of the velocity remains constant but its direction is constantly changing. To change the direction of an object it is required a force that constantly pulls the object towards the center of the circle. This force is called centripetal force. In the solar system, the source of the centripetal force is the gravitational force of the sun. Without the centripetal force coming from the sun, the planets would travel in a straight line.
The centripetal force can be calculated as: FC = mv2/r
Figure 1: Satellite of mass m1 orbiting Earth at an altitude r. The centripetal force experienced by the satellite is due to the gravitational force acting on it.
When an object, like a satellite, is in a circular orbit, gravity is the only force acting on it, which means that the centripetal force must be equal to the gravitational force: FC = FG
From this equation we can calculate the velocity that the satellite needs to stay in orbits around the Earth:
FC = m v2/r = FG = G mM/r2 → v = sqrt (G M/r)
where m is the mass of the satellite and M is the mass of the Earth.