The physics of pulses in gamma‐ray bursts: emission processes, temporal profiles and time‐lags