The theory and math may account for some of it but The dropout rate is high on the Intro classes though, which are usually just ‘java 101’
I think a lot of people start CS without having coded before, find it more difficult than expected, look around and see half the class have been coding a few years and are way ahead and decide it’s not for them