If space is a vacuum, how do stars form? According to what I have read, stars are formed due to the accumulation of gas and dust, which collapses due to gravity and starts to form stars.  But then, if space is a vacuum, what is that gas that gets accumulated?
 A: Space is not a full vacuum. It's mostly a vacuum, and it's a better vacuum than the best vacuums that can be achieved in a laboratory, but there's still matter in it. See interstellar medium.

In all phases, the interstellar medium is extremely tenuous by terrestrial standards. In cool, dense regions of the ISM, matter is primarily in molecular form, and reaches number densities of $10^6$ molecules per $\mathrm{cm}^3$ (1 million molecules per $\mathrm{cm}^3$). In hot, diffuse regions of the ISM, matter is primarily ionized, and the density may be as low as $10^{−4}$ ions per $\mathrm{cm}^3$. Compare this with a number density of roughly $10^{19}$ molecules per $\mathrm{cm}^3$ for air at sea level, and $10^{10}$ molecules per $\mathrm{cm}^3$ (10 billion molecules per $\mathrm{cm}^3$) for a laboratory high-vacuum chamber.

A: As people like to think,Vacuum is space that is devoid of matter like air etc. Space is not strictly a vacuum at all places, but it is better vacuum then we obtain in laboratories. when we say space is vacuum it means it doesn't have air to breathe. But space still has matter. You are right universe  including stars was formed when gas called solar nebula and dust collapsed. Space is very vast. It has dust particles, gases like helium or hydrogen, rocks, asteroids, planets, galaxies, oort cloud, orion, black holes, satellites etc. the reason we call space a vacuum is that the atmospheric pressure of outer space is very low. Vacuums are regions of low pressure.
A: Basically speaking, the space used to be a gigantic nebula, but most of it collapsed, forming the primordial stars. These stars went supernova, spreading it's material throughout space and making nearby nebula collapse. This process goes on, with the difference that the new stars have heavier elements. This is an oversimplification, though.
A: As Allure points out, space isn't a pure vacuum, but it's still better than any vacuum we can make. But how does that very, very good vacuum add up to something as enormous as a star?

Space is big. You just won't believe how vastly, hugely, mind-bogglingly big it is. I mean, you may think it's a long way down the road to the chemist's, but that's just peanuts to space.

For example, the Carina Nebula is 230 light years wide or about 2,000,000,000,000,000 km. It has a volume of about 50,000,000 cubic light years or 10^61 cubic centimeters (10,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 cubic centimeters). If each of those cubic centimeters contained just one hydrogen atom, that's enough hydrogen to make over 8000 Suns.
A: See, in space it is not a perfect vaccum.
Now there is matter that exists like gas clouds-which collapse under their own gravity (they have a mass to gravitationally interact with each other), swirl in, rotate, can momentum, collide and form stars. The only thing is that satisfies the reason to call space a vacuum is that there are very low energy densities. (like energy concentration-how much energy you have-convertible to matter-per unit volume)
A: Your question implies that there can't be init acceleration / momentum in a vacuum.
If people like you and me speak about a vacuum, we mean nothing else but being in a habitat in an isolated concern — like we are in a box — where the air had been removed.
The concerning part of your question is indeed — if there is literally no time to alter the frame — how can the picture change? Creating a vacuum is always against the surrounding state - it's just a container containing less or more elements against the next to its world.
So vacuum won't slow us down or speed us up. It's just an inner state compared to an outer state.
