A stable sort preserves the relative order of equal elements. If two items compare equal, they appear in the same order in the output as in the input.
Example: Sort students by grade. With a stable sort, students with the same grade stay in their original order (perhaps alphabetical). With an unstable sort, their order is arbitrary.
Stable sorts: Merge sort, insertion sort, counting sort. Unstable sorts: Quick sort, heap sort, selection sort.
Stability matters when you sort by multiple keys. Sort by secondary key first, then by primary key with a stable sort. Both orderings are preserved.