Let's invent our own unit: the "grocery-year" -- one grocery-year represents the amount of money needed to buy one year of groceries.
Now let's say I am making $100k this year, and spending $10k on groceries. My annual salary is ten grocery-years (though I'm saving nine of those).
Let's assume that inflation is 10%, but I get a 5% raise. You're absolutely right that my net income will increase in dollar-terms (i.e. I'll spend $11k on groceries now, but make $105k; a $4k net increase). The issue here is that in actual purchasing power, my salary has gone down: my annual salary is now only 9.54 grocery-years.
Obviously not everything experiences the same rates of inflation, but the idea here is that inflation affects all of your income, not just the income you're spending. Likewise, my actual purchasing power will decrease if my raise doesn't match inflation, regardless of how much actual purchasing I do in a given year.