50000 years after the big bang the Matter era
begins
During this time the temperature of the universe was cool enough
for electrons to combine with atoms and this is when the Cosmic
Microwave Background appears. The CMB is the last few photons that
were scattered by electrons before they joined with atoms as the
universe cooled sufficiently. Shortly after the formation of the
CMB, the newly formed atoms will form these protogalactic clouds
which would end up becoming the galaxies and stars that we know
today.
The hydrogen and helium formed in the last epoch
form these huge massive clouds which would form stars and
quasars, quasars are black holes with a gaseous accretion disk
that shine very brightly due to the radiating accretion disk.
These quasars are the starting points of new galaxies.
Star formation continues and as stars die they
explode into a supernovae leaving behind a nebulae and inside
that nebulea a bunch of heavy elements that were not produced
during the atomic epoch are found there, this is essentially how
elements heavier the elements are formed.