Inflation is usually described as prices going up. The stranger version is the one shoppers actually notice: the price stays the same and the bag gets lighter. Shrinking the product instead of raising the sticker price is a way of passing on higher costs without the headline number moving.
The economics is not mysterious. If sugar, packaging, and transport cost more, the seller has three options: absorb the cost and lose margin, raise the price and risk losing customers, or reduce what you get for the same money. All three are responses to the same squeeze, and all three end up costing the buyer something.
This is why inflation statistics are built from baskets of goods with careful attention to quantity, not just price tags. A pound of sweets that becomes twelve ounces is a price increase even when the tag never changes. Once you see it, you cannot unsee it in every aisle of the seasonal display.
