Theory of energy dissipation in heavy-ion reactions