This one caught me out, but its clear why if you think about it for a moment. If the new firmware has the same variables in the same order as the previous firmware, it looks like retained variables survive the firmware update. Altering the variables results in re-initialisation of retained variables, as everything has moved about in memory.
It would be nice if we could specify RAM addresses for retained variables, so they (might) survive a firmware update. EEPROM is an alternative, but not for something that gets rewritten constantly. And since System.updatesPending() isn’t working properly at this time, there’s no way to store vars in EEPROM just before an update.
Worth noting in the documentation.