Going beyond the framework discussed in the Introduction, this section outlines the fundamental theory of cavity QED. Section 2.1 starts off by reviewing the formulation of molecular Hamiltonians. Section 2.2 similarly reviews quantum electrodynamics (QED). Section 2.3 discusses the most common cavity QED Hamiltonians as they are represented in the full Hilbert space. Section 2.4 then goes on to show recent advances and controversies on how to accurately represent these QED Hamiltonians in a truncated Hilbert space. Section 2.6 discusses a further extension of the typical QED Hamiltonians to models which include many molecules and many photonic modes in a single cavity.