Even after more than 45 years of their discovery in late 1960s, the radiation mechanism of gamma-ray bursts (GRBs) remains unclear. Since the main component of GRB prompt emission in sub-MeV energy range exhibits a non-thermal nature with a smoothly-joined broken power-law spectral shape ("Band function"), the synchrotron radiation of relativistic electrons in the emitting region has been put forward as the leading mechanism that powers GRBs. However, it was soon realized that the standard synchrotron spectrum in the fast-cooling regime is not consistent with the observed low-energy spectral index of prompt emission spectra, and as a result, the synchrotron mechanism has been disfavored and other photospheric models were invoked for the prompt emission. Under these circumstances, a theoretical breakthrough in understanding the GRB radiation mechanism is recently made on the synchrotron side. It is shown that, when the magnetic field strength in the emitting region decreases in time, the fast-cooling synchrotron spectrum is in fact in a non-steady state and becomes significantly harder than the "standard" one, becoming well consistent with the observed low-energy index. This new physics of synchrotron cooling of relativistic electrons also applies to the GRB afterglow phase where the magnetic field strength in the shocked region naturally decreases as the blast wave propagates through the surrounding ambient medium. Therefore, when the blast wave is viewed as being made of numerous mini Lagrangian shells, different shells have different evolutionary history of the co-moving magnetic field strength, so that deriving the current value of cooling frequency of each mini shell requires an integration of its cooling rate over the time elapsed since its creation. This requirement has been recently identified as the physical origin of a very mild and smooth cooling break in GRB afterglow spectra, thus providing a natural interpretation for the non-detection of a sharp cooling break. Recent theoretical developments made on the blast wave dynamics will also be described for generic models with various density structures in the ambient medium (such as a density bump or void). Finally, a simple analytical treatment is introduced for the curvature effect of a relativistic spherical shell, showing that the standard relation between the temporal and the spectral index is significantly deviated for an accelerating or decelerating shell.