How did planets come into existence?
Gravitational forces acting on mass.
If you think of the universe as just dust after the Big Bang, those bits of dust would have mass and everything that has mass has a gravitational field.
Eventually, bits of dust would be pulled towards each other creating a larger object (or larger piece of dust) and that object would have more mass meaning it would have a greater gravitational effective on particles around it creating a bigger clump of material and so on and so on. These particles can be gas particles or microscopic grains of elements (a whole range of things).
Our sun would have been probably the first thing that was created in our solar system, since we all know the Sun is HUGE, it would have a great effect on objects in space forming a spherical cloud or ring around itself, and objects in that ring or spherical cloud would have their own mass, attracting masses smaller than itself to from bigger masses of particles. The aftermath of this is what we call "planets".