Dynamic energy and dynamic power in microprocessors
Energy in a capacitor = \$\dfrac{C\cdot V^2}{2}\$

That is the standard formula for the energy stored in a capacitor by virtue of it being charged to V volts.

If this energy is liberated (lost) into heat at f times per second then the power liberated is

\$\dfrac{f\cdot C\cdot V^2}{2}\$


  Also what is switching frequency in the context of computer hardware?
  Is that the speed the CPU operates at (e.g. 2.5GHz)?


Most of the energy lost due to "driving" capacitance will probably be from IO from the CPU such as driving the bus - although the frequency (f) will be much smaller than 2.5GHz (for example) the PCB track capacitance and input capacitance of bus chips will make this the dominant losses in a lot of cases.

Here's a good website that gives the derivation for energy: -