State space models work by defining hidden states that represent the true but unobserved aspects of the epidemic, such as the number of susceptible, infected, and recovered individuals. The state equation describes how these states evolve over time, often using differential equations. The observation equation then relates these hidden states to the data we can observe, such as reported cases and deaths.