Costco and WalMart do an entirely different kind of business. Costco only sells stuff that they can get at a huge discount. They don't carry everything, and the products they offer come and go. They don't have to operate on a tiny margin like full-service grocers -- including Wal Mart -- have to do.
Yeah, but Sam's Club operates pretty much the same way Wal-Mart does. And I don't believe that Costco is pulling in bigger profits than Wally World, no matter what their margin is.
It would be more accurate to compare Costco with Sam's Club since both follow the same kind of business model. And Costco is apparently doing a better job at it.