I learned CS in the 70s
Back then, there weren't that many of us and even less who were good at it. I was paid and treated very well.
Then the word spread, making software was the key to high pay, and the flood started.
Thousands of students of varying talent flooded into colleges. Business leaders and politicians told everybody to learn to code. Boot camps and private tutors appeared. Soon there was an abundance of programmers, but few who were excellent. Talent is real. It takes a special kind of mind to be good at making software.
In boom times, even the less talented could find work, copying and pasting code fragments and using poorly understood frameworks to quickly and cheaply churn out mediocre code. People in foreign countries also learned to code, and had the benefit of being really cheap.
Now there are way too many people with mediocre talent competing for jobs. The best of the best have no problem, but the rest will learn the meaning of the word "oversupply". This would have happened even without AI, but AI is definitely a factor