Nobody's at all sure what causes gamma ray bursts.
For many years nobody even knew how far away they were. If they really were in other galaxies their source would have to be almost unimaginably powerful to be so easily observable at that distance. For a year and a half or so it's been known that some GRB's also emit visible light, but only if you catch them quickly. Furthermore, it appears that the gamma ray burst intensity and the optical intensity don't correlate very well. The difficulty is that when these gamma ray burst events happen, it takes a while to get an error box mapping where in the sky the gamma rays came from.