When you have over half a trillion of revenue a year the fractions of a percent add up.
Doing this allows them to negotiate a lower price from the manufacturer or get the manufacturer to adjust the ingredients to lower the COGS. So either it increases their own margins or allows them to have lower prices than the competition.