Why is computer science hard? Data pretty regularly shows that computer science programs have among the highest failure and dropout rates of any college program. A number of sources all echo the finding that roughly one-third of incoming CS majors do not progress to a second year, higher than most other majors.

Computer science undergraduates most likely to drop out (ComputerWeekly.com, 2019)
Concern over drop-out rates in computer science courses (The Irish Times, 2016)
Why are computer science drop-out rates so high? (Trinity News, 2016)

I teach computer science majors at a U.S. community college, and the non-passing rates are even higher in this context. A few times in my introductory programming course, I will mention this fact (that computer science is among the hardest majors), partly to set expectations that students will need to work hard to succeed.
This semester I had a student in my virtual office hour ask, &quot;Why is computer science harder than other majors, as you say?&quot;, and I was a bit flat-footed for a good response.
So: What would be the best reply to a beginning CS student who asks, &quot;Why is CS hard?&quot;
The difficulty of CS (true or imagined) and the drop out rates are not the same thing. Let me start an answer, but it might take several iterations to get all my thoughts together on the two ideas.
Two themes come immediately to mind.
The first is periodic and I don't know where we are in the period at the moment. But in certain combinations of economic factors and media hype, a lot of students go in to CS not really understanding what they are getting in to but are lured by the, perhaps elusive, draw of big salaries. There is a lot of hype out there about AI at the moment, and self driving cars, and going to Mars, etc. People get in for the wrong reasons and decide they really didn't understand what it was and that they don't really like it. It doesn't need to be hard to drive people away, just boring.
The second major theme is that there is a lot of bad teaching around CS as has always been the case. Some people teach it as misspelled mathematics, which it is not. Some people in elementary and secondary schools are forced to teaching CS and especially Advanced Placement CS when they have little understanding of the topic and just try to stay &quot;one week ahead&quot; of the students. This is, and has always been a recipe for disaster. I don't blame the teachers who have to do this as many are forced in to it (in the US) simply because schools are underfunded and understaffed with too few specialist teachers.
WRT the second theme, it might even be that the current push to teach &quot;CS&quot; in elementary schools is actually part of the problem, not the solution. A serious college level course in CS might be shocking to someone who has only dabbled in trivial elements of programming. In particular CS is NOT programming, though skill in programming is needed.
Too many beginning students and teachers think that programming is &quot;if&quot; and &quot;while&quot; and &quot;assignment&quot; and nothing else. The current AP curriculum, I think, is seriously flawed (dropping interfaces, in particular). Students program in &quot;rich&quot; languages and environments using only the lowest level concepts, never really understanding abstraction or (gasp) polymorphism. Compare that with big ideas that you find in a philosophy or (hopefully) history course.
And if you combine that with asking them to write programs that they find boring, they aren't likely to stick around for long.