There is always more to do, even if it might not be in your immediate job description. If you work at a company that rewards productivity, then you will do well. If you don't work at a company, or for a boss, who rewards productivity, regardless of automation, why would you stay?
The only thing I can think that is worse than doing an automate-able task over and over is lying fallow while a program does it for me.
This is why i am a big fan of having a large segment of the population be self-employed - they can extract the full benefits of their labour.
By making sure equity is generating returns for you, that is how one prevents oneself from being automated out of a job - a job's value is an equity that is fully captured by the employer, esp. if it's a long term asset like code. You only capture this equity if you work for yourself. It is risky - failure means certain death (or realistically, just go back to being a worker, and you lose your chance to get out of the rat race).
May be a paradigm shift in society can occur to change this situation, but as i can see it, the only way one can be sure of having a retirement is to ensure one has equity that can generate the funds needed. And the only way to do that is to either work for an employer who will give that equity to you (which a lot of tech companies do), or work for yourself.
The average return is zero though. Risk free interest rates are about 2% and inflation is 2%, and very importantly, your actual return can be below zero as well as above it.
Saying owners have it better off than workers seems essentially the same as saying it's easy to beat the market (capital markets in general) consistently. A lot of people scoff at that regularly, including on HN.
That's because the business that is giving you some equity as compensation is underpaying you, and instead choose to pay with a cheaper alternative (cash).
The fact that the business is able to pay you such high cash rates means that the business is very profitable. I'd argue that the business is extracting some 90-95% of all the value you create, and leaving you a tiny bit (which is still high, and therefore, you get a good salary). But look at the people who owns the assets you create as part of your job - their networth is growing tremendously - much more than yours is through enumeration. This is only true because you are underpaid relative to the value derived from your work.