Inelastic scattering and carrier capture by defects in semiconductors are the primary causes of hot-electron-mediated degradation of power devices, which holds up their commercial development. At the same time, carrier capture is a major issue in the performance of solar cells and light-emitting diodes. A theory of nonradiative inelastic scattering by defects, however, is non-existent, while the the- ory for carrier capture by defects has had a long and arduous history. Here we report the construction of a comprehensive theory of inelastic scattering by defects, with carrier capture being a special case. We distinguish between capture under thermal equilibrium conditions and capture under non-equilibrium conditions, e.g., in the presence of electrical current or hot carriers where carriers undergo scattering by defects and are described by a mean free path. In the thermal-equilibrium case, capture is mediated by a non-adiabatic perturbation Hamiltonian, originally identified by Huang and Rhys and by Kubo, which is equal to linear electron-phonon coupling to first order. In the non-equilibrium case, we demonstrate that the primary capture mechanism is within the Born-Oppenheimer approximation, with coupling to the defect potential inducing Franck-Condon electronic transitions, followed by multiphonon dissipation of the transition energy, while the non-adiabatic terms are of secondary importance. We report density-functional-theory calculations of the capture cross section for a prototype defect using the Projector-Augmented-Wave which allows us to employ all-electron wavefunctions. We adopt a Monte Carlo scheme to sample multiphonon configurations and obtain converged results. The theory and the results represent a foundation upon which to build engineering-level models for hot-electron degradation of power devices and the performance of solar cells and light-emitting diodes.