According to the Big Bang Theory, the universe began with a period of rapid expansion (the Big Bang), followed by the formation of galaxies as matter clumped together under the influence of gravity, and then the formation of stars within those galaxies.