In most scenario (assuming good demand for the stock you are buying and a functional market etc.,) a market maker, looking at their order book, buys 7 items from A. They sit on it until they are able to dispose off them to a buyer. In effect, you, as a buyer is buying a stock from market maker.
Most of the equity market is not P2P but mediated by market maker. They take the liquidity risk (i.e., holding a bad stock if demand plummets) and are rewarded for that by making money off of every transaction through bid-ask spread.
Of course I'm greatly simplifying as an equity order goes through a bunch of intermediaries but Market Maker play a central role here.
In most scenario (assuming good demand for the stock you are buying and a functional market etc.,) a market maker, looking at their order book, buys 7 items from A. They sit on it until they are able to dispose off them to a buyer. In effect, you, as a buyer is buying a stock from market maker.
Most of the equity market is not P2P but mediated by market maker. They take the liquidity risk (i.e., holding a bad stock if demand plummets) and are rewarded for that by making money off of every transaction through bid-ask spread.
Of course I'm greatly simplifying as an equity order goes through a bunch of intermediaries but Market Maker play a central role here.
[1] https://www.investopedia.com/terms/m/marketmaker.asp