If you're doing different things within the same company every few years, and taking increasingly more challenging and essential roles, then employers will likely look very favourably upon that because having that progression shows that you will likely produce a lot of value for them.
Why? With the exception of a few niche domains (scientific research, pharma, etc), it doesn't take very many years to master a domain. The problem set can only get so varied and complex. In fact, it's quite the opposite; problems tend to get less complicated over time as they get more automated/well known. Easier to solve == cheaper to hire for.
Most people that have been with a "young" company for 20 years that hasn't turned itself over and are high value will likely have large networks and will be somewhat well known by dint of having closer ties with the founding/senior leadership.
So if you're doing the same rote job for n years, and the costs of hiring someone to replace you and train them are greater than the costs of keeping you, then you are vulnerable to "redundancy." While there is NOTHING WRONG with wanting to do the same thing forever and prioritize other things, this is the risk that comes with that. (I personally have no idea how people achieve that; there is so much opportunity in the world to make money, and being restricted by money sucks).
This was true of cotton millers, milkmen, switchboard operators, and is still true for developers and operators.