Why the planets of the medium have gravity? Why i'm asking that, the answer is so obvious MAJYYKS.

Every celestial object has its own gravitational force