You can only see the symptoms, never the cause — but from a stream of clues you can name the single most likely hidden story behind them. Given ‘normal, cold, dizzy’, the most probable run of health states is Healthy, Healthy, Fever. This is how a phone turns sound into words. Slide the clues in and watch the best path light.
A hidden Markov model has states you cannot see (Healthy/Fever) that emit clues you can (normal/cold/dizzy). Viterbi fills a trellis: the best probability of reaching each state at each step = max over previous states of (their best × transition × emission), remembering the winner. Tracing back the winners gives the single most-likely hidden path. A fail-loud self-check throws unless the classic example decodes to Healthy → Healthy → Fever — the exact dynamic program behind speech recognition and gene-finding.
A tiny 2-state / 3-symbol model with fixed probabilities; real decoders have thousands of states and learned parameters (and pair Viterbi with beam search). The trellis recursion and the decoded path are exact.