In the former case, you are the buyer, and someone has sold you shares (via the stock market, clearing house intermediaries, etc.). In the second case, you are the seller, and someone is buying your shares.
If that explanation doesn't work for you, just think of it as buying a pig from...