Brian F. answered 08/08/19
Ex-Apple 🍏 Engineer Tutoring Math to the Tik Tok Generation
I don't quite understand the second part of the question, but to answer the first part, Joule heating, which is energy lost due to heat generated when electrons flow through a resistor. P=I^2*R. If we look at the initial conditions before connecting a resistor to the terminals of the capacitor, the energy stored in the capacitor was E = 1/2*C*V^2. Now energy must be conserved, so as the voltage of the capacitor (hence the energy), the energy dissipated (as heat) in the resistor must increase.