We have some important clues about the nature of gamma ray bursts. We know they are transient, and very short by astrophysical standards. This sounds a lot like another astrophysical phenomenon, a supernova. I didn’t mention this before, but we also know there are two types of gamma ray burtsts named short duration GRBs and long duration GRBs, for obvious reasons. At least for long duration bursts, once the burst itself is finished, we see the usual signs of a supernova. So to wrap up our discussion of gamma ray bursts I am going talk about exploding, dying stars that give rise to supernovae and long GRBs.
Stars are layered, with heavier elements accumulating in the middle, like the layers of oil and water in salad dressing. In salad dressing oil and water separate into layers because gravity is pulling on them. In the same way, gravity pulls on all parts of the star, except that there is so much stuff in the star that the gravity is overwhelming. Being put under such extreme pressure causes lighter elements to fuse into heavier elements. In keeping with our salad dressing analogy, the water is being pulled so hard by gravity that it turns into oil. This fusion process releases energy, and that keeps the star from falling in on itself. This is where stars differ from salad dressing, which can support themselves without requiring energy from fusion. But stars are much bigger than bottles of salad dressing, which means that there is a lot more gravity to push up against if they are not to collapse. Luckily, that same enormous mass allows stars build high pressure and start fusion, which pushes outwards against the gravity. Stars are usually in a state of balance, with fusion providing the energy to push outwards and gravity pushing inwards.
At the ends of their lives, stars have a dense iron core in the middle. The iron comes from light elements like hydrogen fusing into heavier elements such as helium, which then fuses into heavier elements, and so on. The problem with iron is that it is the top of the food chain. The iron in the core doesn’t fuse like the lighter elements in stars, so there is no energy being released, and the core can no longer hold itself up against gravity. At this point, the iron core collapses. It grows smaller and denser until it becomes so dense that nuclear forces take over. I will forget about what exactly that means, and I will only mention here the end result, which is that the iron core of the star becomes a neutron star, or possibly a black hole. Afterwards, material outside of the neutron core is exploded into space at speeds up to 30 kilometers per second, which is about 1000 times as fast as you drive. The nature of this explosion is yet to be fully understood, but it results in the bright light we see when we observe some types of supernovae.
Long duration gamma ray bursts are thought to occur when stars die as well. The neutron star accumulates some of the other stellar material, and then it shoots it out along an axis, via a magnetic field. You can see what I mean by looking at the picture, which also shows how a star collapses, courtesy of Nicolle Rager Fuller/NSF.

The origin of short duration gamma ray bursts is still uncertain. They are believed to originate from neutron stars colliding with other neutron stars, or black holes. You can read more about GRBs here and you can also read about the gravitational collapse here, and neutron stars here. Having read about dying stars, you should be well-equipped to read all about those astrophysical phenomena with exciting names, and others.