Well, largely this is down to inflation. Inflation was caused by a strange sort of matter that has a nearly-constant energy density. This nearly-constant energy density drives a rapidly-accelerated expansion. And because the energy density is nearly constant, the total energy increases dramatically along with the expansion.
However, the energy density isn't perfectly constant: it tends to decrease very slowly with time. Once the energy density reaches its minimum, the field tends to decay into normal matter particles.
So you start with a teeny tiny bit of this stuff that causes inflation, possibly caused by a quantum vacuum fluctuation, and then the expansion causes this energy to be multiplied by an obscene amount. Once the field that drives inflation decays, the energy becomes the matter we know and love.