I think the answer is mostly AI - students are quite terrified about what AI will do to software engineers.
Personally I believe in the Jevon's paradox side of things so I still got my degree in CS even though I could have switched.
Besides AI, I think people are also realizing that the Golden Age of Tech where you could be a SWE at FAANG without actually knowing how to code, and work 10-2pm is largely over. CS is no longer the easy path to a cushy well-paying job, since if you can't perform, you'll get laid off.
So the students that remain in CS genuinely like it / believe in their capabilities.