I have an in-demand set of skills and could easily find a new job if I wanted to.Let's imagine someone makes an AI project that can turn requirements into code, and it actually works. Copilot has shown it's not impossible to generate working code with some machine learning but it's definitely a hard problem. There are hundreds, maybe even thousands, of founders working on this problem right now and maybe one will get lucky.
How long do you think you will be in demand for? Years? Months? Less? Perhaps you'll be fine because you actually define the requirements. Or you're in a job where the AI can't replace you. It would replace a lot of people working in the simple CRUD app end of the dev industry though, and that means pressure to keep wages up would fall away fast if there are more devs than dev jobs. You wouldn't get a raise if there are 20 devs who'd jump in to your role for less money if you left. You couldn't negotiate better terms. If you left you'd be competing with lots of others which puts more downward pressure on your salary.
That's one vaguely plausible scenario of how things might change in the next 10 years. There are many more. Right now devs are very well paid but we should all recognize that for what it is - an opportunity for industry disruption. Our salaries are (partly) lost profit. Companies don't want to pay us as much as they do; they pay market rates because they have to. If a company can reduce that cost by lowering wages or lowering headcount every tech employer is going to jump on the opportunity. Founders out there know this is a pain point, and they're working on solving it.
Maybe having a union for devs would actually be useful if that ever happens.
(FWIW technological change reducing manpower requirements has been a massive driving force behind unionization in many other industries. The scenario is sound even if the "AI writes your code now" bit is a little fantastical.)