Amazon's biggest revenue segment is its retail business. Retail makes more money than any other segment. Retail's margins are razor thin. This is good for Amazon as it builds a huge moat for any competitor to enter this segment. (Having said that competitors are doing well in some lucrative verticals e.g. Stitchfix for clothes)
Amazon doesn't have to worry too much about margins as Retail has huge volume and low margin on huge volume is still big. And it has high margin segments (AWS and Advertising both discussed below)
First party
Here Amazon buys, stocks and sells products to customers. It includes Amazon's own products (Echo, kindle etc..) and non-Amazon products that are sold and shipped by Amazon.
Third party
Here a third party seller signs up and subscribes to Amazon FBA (Fulfilled by Amazon service). This component made a 27B revenue in Q4 2020
Competition here is Shopify
In comparison Shopify made a 977 million revenue in Q4 2020
Although it is not fair to compare Shopify with Amazon FBA. Amazon had a merchant store that was very similar to shopify.
<aside> 💡 In September 2015, Amazon.com announced it would be closing its Amazon Webstore service for merchants, and had selected Shopify as the preferred migration provider;[36] Shopify's shares jumped more than 20% upon the news.
</aside>