When the first stars in the universe were formed a few hundred million years after the Big Bang, the universe was still opaque to many wavelengths including visible light. At this time the universe mainly consisted of neutral hydrogen gas which does not transmit any visible light. But now the first stars and galaxies formed and their young, hot stars emitted a lot of light; not just visible light but also high energy ultraviolet light and X-rays. This strong radiation was able to ionize the neutral hydrogen atoms, which means that it kicked off the hydrogen's only electron separating the atomic nucleus (a single proton in case of hydrogen) from the electron. This small change makes a lot of difference! Ionized hydrogen is transparent to visible light. Today most hydrogen gas in the universe is ionized and we can see far into the universe and discover galaxies many billions of light years away. An example of the light blocking capacities of neutral gas can be seen on the image of Barnard 68, a dark cloud of neutral gas that blocks all light from the stars behind.
This process is called reionization, but you can also call it "the end of the dark ages" since the universe became transparent to visible light. This video shows you beautifully the reionization epoch when the first galaxies formed and our universe started to get transparent to visible light. Yellow dots are galaxies, neutral hydrogen is brown and the transparent, ionized gas is blue. If you are interested in the whole story from the Big Bang to today don't miss our article about the history of the universe.