We are 3 developers, not a mega company. In the end, it's much less effort than people imagine because the time you don't spend dealing with vulnerabilities and update problems is the time you spend developing your own instead.
The reason is mostly historical because of the ease of access and the lack of alternatives. For more than a decade, there wasn't much else besides PHP, obtainable on a shared hosting offer. Other techniques were harder to access because they meant requiring either an initial money investment or the danger of maintaining your own server. Today, with AWS, Azure and what-not, it's not like that anymore.
Our search engine has 15 000 000 videos. 96 % of search queries are served below 0.4 seconds and it's hosted on a single VPS with 4 cores and 8 GB ram. Most things are written from scratch aside from some very common software. We are 3 developers maintaining and extending this. We are currently working on automatic typo-correction without breaking the 0.4 second rule. Our biggest bottle-neck right now is the loading time of thumbnails.
Imagining we did this in PHP instead, our initial development time would have been lower (it took us 3 months to get the minimum-version online, with PHP maybe just one month?) but the server costs would have been HUGE now (or our website would be slow af and suck).
I'm new in the adult business. Maybe my mindset is just wrong. But we are trying to build a great new product. Building something amazing and new, is just not possible on Wordpress, in my opinion
Feel free to keep this post and laugh at me when I start making Wordpress websites myself in a few years after failing and failing. Who knows.