We don't really know for certain. In nuclear physics, we know that some kinds of particles decay with slightly more frequency into matter particles than anti-matter particles. The K meson for example. This 'symmetry breaking' was also present when the universe was young so that presumably from an initial symmetric state of matter and anti-matter particles, slightly more matter would have been produced in the decay products leading to a slight 1 part in 10 billion excess of matter over anti-matter. Once the annihilation process was complete, you wound up with 10 billion gamma ray photons for every matter quark. We don't know why this kind of symmetry breaking occurred, but like all the others, it just seems to be the way that nature prefers to work, in the same way that it prefers that the speed of light have the value that it does, etc etc.