I saw the link to earnings explained as being so that pensioners share in the economic growth of the country. Which actually seems pretty reasonable.
(Although given our very low levels of economic growth currently, perhaps that's less significant than we might think...)
But the ratchet effect - using the highest of the measures each year - hasn't played out well under the extremes of covid and high inflation. Earnings growth lagged inflation by a year or so, and pensions benefitted from each increase in turn. This wasn't really the intention: the later earnings increase were a reaction to inflation - rather than reflecting genuine growth - and so the rise should only have been counted once.
I'd have preferred it to be smoothed out instead. Eg taking an average of inflation and earnings growth rather than the higher. Or alternatively, averaging each measure over 5 years before taking the highest measure (although that does result in a lag).