The gravitational force of the Sun and Mars keeps the Mars in its orbit. Due to the gravitational force of the Sun it doesn't move away from our Solar System. Due to the Gravitational force of itself, it doesn't hot engulfed by the Sun.
5.9m questions
7.7m answers