You buying 5 shares shifts the demand curve for the share to the right, resulting in an increase in the price. (absent a simultaneous proportional increase in the supply of shares).
While it may not feel like your purchase of 5 shares gave Apple capital, your demand was surely part of the aggregate demand and supply that determines Apple’s share price at a certain point in time, and hence informs Apple’s market cap.