"Costco's gross margins are 12%, compared with Walmart’s 24%. The company makes up the shortfall through its membership fees: customers pay $60 or more a year to shop at its stores. In 2023 fees from its 129m members netted $4.6bn, more than half of Costco’s operating profits."
https://www.economist.com/business/2024/02/15/why-costco-is-so-loved