I suspect it happens for a variety of reasons.
1. Food is shipped long distances to the consumer, so when fuel costs rise it's passed along to the consumer.
2. Food cost increases occur in a variety of ways. Have you noticed candy bars are smaller than they used to be? Potato chips have fewer chips in the bag? Simple things like men's socks are more often "one size fits all" which reduces costs for the manufacturer. But...the seller's continue to charge the same or slightly higher prices for these products.
3. In the words of my grandfather, father, and mother -- A dollar simply doesn't buy what it used to.