All retailers do that. It's called private labels. None of the products are made by the retailer either. As unfortunate to those who might genuinely believe Trader Joes products are unique to them, or that Great Value was Walmart using its massive distribution systems to quickly scale core products like Milk out. It's all private labelling.
Amazon is not a traditional retails, it's a marketplace. Walmart buys stock, puts it on sale, gets data and makes decisions upon that. Amazon just skips the expensive first 2 steps by taking data from other retailers on their platform.