Gamma rays are energetic neutral particles which trajectories are not curved in magnetic fields and indicate their source.
The mechanisms emitting gamma rays are different, basically identical with emitting X-rays but at higher energies, including the inverse Compton effect, nuclear reactions (electron-positron annihilation), and the decay of radioactive material in space such as supernovae, pulsars and blazars.
Gamma rays below hundreds GeV directly can be detected with satellites and in the TeV energy range it can only be accessed with ground-based arrays. High-energy photons produce cascades of secondary particles in the atmosphere that can be observed on the ground via the air-Cherenkov light emitted by the ultra-relativistic shower particles.
Video about gamma rays from the YouTube channel NASA Goddard