Among all DFAs recognizing a language, one is smallest — and it is unique. The key idea is when two states can be told apart.
Definition · Distinguishable states
States p and q are distinguishable if some string w drives one to an accept state and the other to a reject state. If no such w exists, they are equivalent and can be merged.
Partition refinement starts by separating accepting from non-accepting states, then repeatedly splits any group whose members transition into different groups. When nothing splits further, each remaining group becomes a single state of the minimal DFA.
Myhill–Nerode, informally
The number of states in the minimal DFA equals the number of classes the language carves Σ* into — a finite count exactly when the language is regular.