Gamma-ray bursts are one of those great mysteries of astronomy. The only thing known that can cause such extremely energetic events is collisions between neutron stars or black holes. That doesn't mean it's the right answer, though. We tend to think we know a lot about the Universe. That's an illusion. It's as if we're on the shore of a vast ocean but only have just recently even ventured to get our toes wet.
It was only 5 years ago that astronomers determined that gamma-ray bursts were indeed distant, extragalactic events. Discovery may be "Smoking Gun" in Gamma Ray Burst Mystery