Physicists at Durham University, UK, who are leading the research, said that their simulations could improve understanding of dark matter, a mysterious substance believed to make up 85 per cent of the mass of the Universe.
Professor Carlos Frenk, Director of Durham University's Institute for Computational Cosmology, said that he has been losing sleep over this for the last 30 years and dark matter is the key to everything we know about galaxies, but we still don't know its exact nature, and that understanding how galaxies formed holds the key to the dark matter mystery.
The Durham researchers believe their simulations answer this question, showing explicitly how and why millions of halos around our galaxy and neighbouring Andromeda failed to produce galaxies and became barren worlds.
They say the gas that would have made the galaxy was sterilized by the heat from the first stars that formed in the Universe and was prevented from cooling and turning into stars.
However, a few halos managed to bypass this cosmic furnace by growing early and fast enough to hold on to their gas and eventually form galaxies.
The findings will be presented at the Royal Astronomical Society's National Astronomy Meeting in Portsmouth.