Gravity keeps satellites in orbit. The closer you are to the
Earth, the faster you have to go to maintain your orbit.
At low Earth orbit, the altitude of the Space Station, you make
an orbit every 90 minutes. At the Moon's distance you need over 27
days to go around the Earth.
In-between there is an altitude which matches the rate of the
Earth's rotation. Many satellites orbit at this altitude.