When the requirements for an algorithm state that it is “stable” without further elaboration, it means:
For the sort algorithms the relative order of equivalent elements is preserved.
For the remove algorithms the relative order of the elements that are not removed is preserved.
For the merge algorithms, for equivalent elements in the original two ranges, the elements from the first range precede the elements from the second range.