What does it mean that a sort is stable, and which detail of the merge decides whether merge-sort is stable?
Stable means that elements with equal keys keep their input order. Merge-sort is stable only if the merge breaks ties in favour of the left half: take from $A$ when $A$'s front $\le$ $B$'s front. With a strict $<$ the right half wins every tie and equal keys swap places.
* The left half always holds the elements that came first in the input, so preferring it on ties preserves their order. *
Stability only matters when equal keys belong to distinguishable records. Typical case: a list of people already sorted by name is sorted again by city. A stable sort keeps the people of each city in name order, an unstable one may shuffle them. Sorting by several keys one after the other, least important key first, works only with a stable sort.
Merge-sort keeps the input order everywhere except possibly at ties: every element of the left half $A$ came before every element of the right half $B$. If the merge takes from $A$ on a tie, equal keys come out in input order. Many textbook versions write the test as A.first() < B.first(); then a tie sends $B$'s element first, and 2a 5 2b 1 comes out as 1 2b 2a 5. One character decides it.
Go deeper:
Sorting algorithm: stability โ what stability means, with the playing-card example.
Python sorting HOWTO: sort stability โ sorting by several keys in passes, which only works because Python's sort is stable.