I'm not sure what you think is so complex. I started doing plugins and themes for it at 15 years old and I'm no genius.
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.