Cognitive dissonance occurs when a person experiences stimuli that does not fit with their existing framework for understanding events, triggering a need for explanation. This happens when anticipations or assumptions about future events are contradicted by discrepant or surprising experiences. To reduce cognitive dissonance, people must reframe their thinking to align with the new stimuli.