It's about whose balance sheet the stock is on.
If Amazon buys an iPhone, and then lists it for sale on the Amazon store, that's Amazon's iPhone. If Amazon doesn't manage to sell it, Amazon has lost money. If Amazon does sell it, they capture the profit margin between the price they bought it at, and the price they sold it at. Apple, who sold Amazon the iPhone originally, has no further business relationship with the person that buys the phone from Amazon; after the initial sale, it became Amazon's phone to sell, and their customer relationship to have.
This is the traditional "retail" sales model. Amazon is only a retailer for a relatively few products—and now fewer.
For any other brand that shows up on Amazon, Amazon is acting as a Logistics-as-a-Service provider to that business. If you buy a Samsung TV on Amazon, then it's coming from an Amazon warehouse, but Amazon does not own that TV; Samsung (or someone else, maybe a retailer!) does. Samsung (or whoever) are effectively renting warehouse space from Amazon to hold their TVs for them, paying Amazon to deliver their products, etc. in the same way that a developer would pay Amazon to hold data in S3 and deliver messages over SNS. If Samsung wants that TV back, Amazon has to give it back. It's not Amazon's property. But nor did Amazon have to buy it. It's neither an asset nor a liability on their balance sheet. They possess it only in the sense that a self-storage business possesses the contents of a storage unit; or in the sense that FedEx possesses a parcel while delivering it.
This is the https://en.wikipedia.org/wiki/Consignment model of sales. The Amazon store is effectively a consignment store.
Well known examples of consignment:
• Commercial art galleries where the works are for sale. The gallery doesn't own the works; the artist is renting space to display and attempt-to-sell their work.
• Brick-and-mortar book stores. (New) book stores don't own their stock of books; the books' publishers do. The book-store-as-storefront has some limited power to declare sales, but mostly sales are "ordered" by the publisher. When a book store can't sell enough of a book, and have left-over stock that looks like it isn't going anywhere, they must nominally "return" the stock to the publisher by destroying it (i.e. by ripping off the covers, like this: https://www.reddit.com/r/whatisthisthing/comments/7mw74c/why...)
Amazon, as a consignment storefront, doesn't make money off the sale itself; nor can they set profit margins or declare sales. Instead, they make money by charging the supplier for their logistics services. In some consignment businesses, this is a simple flat pay-per-use fee; but for the Amazon store, this is taken as a cut "off the top" of the supplier's gross revenue from the products sold.