If Earth’s gravity pulls everything towards the Earth, then how can satellites stay up there and are not falling towards the Earth?
The answer is that satellites orbit the Earth. They have the correct velocity with respect to Earth’s position and gravitational pull.
A satellite has a velocity away from the Earth, but not perpendicular to Earth’s surface. The velocity will persist for a very long time as there is practically no drag in space.
Earth’s gravity will pull the satellite towards the Earth. On the other hand, the satellite is in motion away from the Earth. If its velocity is in the right amount and direction, the spacecraft will orbit the Earth. In other words, it will neither fall towards the Earth nor keep going farther away.
The orbital altitude and shape depend on the speed and direction of the satellite. The farther the satellite, the lower the gravitational force exerted by the Earth, and the lower the orbital speed.
In the frame of reference of the satellite, the satellite and other objects orbiting with it are affected by a centrifugal force away from the Earth. In a circular orbit, the centrifugal force is in the same amount as the gravitational force exerted by the Earth, but with the opposite direction. As a result, a satellite and everything orbiting with it will not feel a ‘downward’ acceleration. An astronaut in the ISS, for example, will float, and cannot walk like in the surface of the Earth.
A popular misconception is that there’s no gravity in orbit. In reality, Earth’s gravity is not much less than on the surface of the Earth. Astronauts feel weightlessness because they are in free fall. Or in the frame reference of the satellite, it has the centrifugal force countering the effect of gravity.
The above explanations deal with the case of a satellite orbiting the Earth, but the same concept is also applicable to all cases of a body orbiting another body.