The physics of gamma-ray bursts