Credit card data. If your household over-indexes in high AUR items, they extrapolate “high-income”. If your avg spend per basket is above the average, they assume you have a large household size or high-income. These are directionally accurate markers when extrapolated across all credit transactions. There are also geographies at play: metropolitan areas are typically higher income, vs rural areas are usually more price-sensitive.
Low-income shoppers typically over-index in Great Value and choose the opening price point item. Walmart also sees when WIC/SNAP benefits are used and can figure out the % of shoppers in each store who rely on government assistance.