Equal keys can carry an existing order
Records with equal keys can carry different payloads. Sorting timestamp-ordered transactions by city can group cities while retaining arrival order within each city. An unstable method can order cities correctly yet lose that prior ordering.
Equality concerns the selected key or comparison rule, not necessarily the entire record. A name-only sort treats namesakes as equal keys; adding age changes the equivalence groups to which the stability guarantee applies.
Sorting secondary keys before primary keys
Stable passes can build a multi-field ordering by sorting secondary keys first and the primary key last. Sorting students by age and then stably by grade retains age order within each grade. Reversing the passes generally changes the intended priority.
A composite key can instead encode several priorities in one comparison. Stability is particularly useful when a new step handles one key while intentionally retaining ordering already present in its input.
References: [2]
Implementation rules establish stability
Insertion can avoid crossing equal keys, and merging can take the left record first on ties. Ordinary selection, heap and quicksort exchanges can instead move equals past one another, although redesigned variants can have different properties.
Adding the original index as a final tie-break explicitly encodes prior order but requires storing that index. Stability does not establish that upstream ordering is meaningful or repair an inconsistent comparator; those remain separate requirements.