Some physicists would claim that physics was responsible for the formation of the galaxies and stars, the solar systems and the planets, and they may have a claim. But it is chemistry that has done all the interesting stuff with them. Still, first physics must be given its due...
The young universe did not have a perfectly even distribution of matter and energy. These irregularities caused both electromagnetic and gravitational forces to build up in certain areas, gathering matter in to concentrated areas.
As time passed these areas became separate clouds, nebulae, of particles and started gaining more structure. As the mass of the clouds increased, their own gravity caused them to collapse in on themselves, and gather to form stars. Groups of stars gathered to form galaxies and the Universe as we perceive it was born.