In principle, unless the Government reverses it (which they are semi-consistently somewhat threatening to do), UK pensions are supposed to be protected by a "Triple lock". They increase each year by whatever is the highest out of inflation, average wage, or 2.5%. So if the country tanks and inflation skyrockets, they are supposed to get an increase to match it.
But a large number of pensioners have a ridiculously tiny private pension (or none), so the state pension is a large and essential fraction of their income and the triple lock remains relevant to pension-age voters.
Many pensioners have a spre property by one means or another (often inherited - "accidental landlords"), which they rent out to supplement their pension. As rents have tended to go up with or even faster than general inflation until recently, this buffers the effect of inflation on those pensioners too.