Browsers got complicated because they weren't seen as a platform to ship code to... They were seen as document renderers.
There wasn't anything to "compose with" for a meaningful history of browser development. You shipped a document (html) with some optional styling, and the browser handled EVERYTHING.
JS was a very minimal, underpowered, runtime that was decidedly NOT the thing to use for any real composition that resembled backend/desktop coding. The tools of the time for that were flash and activeX and silverlight.
Javascript was just a thing you used if your checkout form needed to be more complex than normal, or you wanted to show off a bit.
---
Then Ajax came along in the early 2000s, sites got increasingly complex and interactive during the web 2.0 push, js got progressively more powerful (to the point where the js runtime is functionally not that far off a real OS in complexity and capability) frameworks hits the scene, and people finally had the right tools to actually implement a single page app using web tools.
---
So...
1990 to 2005: Browser is solely a document renderer, every new cool thing has to be implemented by the browser.
2005 to 2015: Browser is mostly a document renderer, but you can do cool new interactive things, and you needed to paper over lots of rough patches with js.
2015 to 2025: Browser can ship meaningful applications that run entirely in the client, and the "document" model has faded a bit (although it's definitely NOT gone) while new complexity largely lives in expanded system access and capabilities (ex - usb access, crypto, complex networking, async processing, web-assembly, etc).
---
The challenge is that people who want the "document" model still want it all implemented by the renderer, and there's enough historical momentum there that you basically can't undo it without starting from scratch to deliver applications instead of documents.
Further (and this one is entirely on you) the real comparision isn't "unixes" it's a graphical env. So compare the complexity and attitude to win32 dialog apis, QT, etc...
Often they also ship with a huge library of components built in. Because the users of those systems don't really want a canvas they have to render everything on... rendering is hard. Rendering performantly is really hard.