It’s not necessarily hard. But it’s cumbersome and just one of the worst codebases I ever had the pleasure of working with. Basically everything about it is legacy, bad design choices, hacks, workarounds and compatibility fixes. That’s what makes it complex. It needs a rewrite 10 years ago. But due to the deep integration of thousands of plugins that will never be possible.
From personal experience, the complexity comes from how ‘not obvious’, unexpected, or (outwith WordPress) unconventional much of WordPress is.
It is a fascinating code base that is a result of it evolving through end user needs, over years, rather than being a grand software architecture with developer ergonomics at the core. Last time I touched it, changing domain names and sync dbs all required plugins. Yet in page editing works like magic.
I assume no-one building Wordpress today would build it like it is build.