I have Win 11 up and running on the 2017 iMac 27 inch as I type this, with the screen set at 2560 resolution. Going into the Parallels desktop I have two full=size Firefox windows open, the text looks like it's about 3 pt type, and it's clear as crystal. Switching to the Envy, I can open two browser windows on that thing and even with substantially larger type size it's fatiguing to look at for any length of time. The standard fonts look like grains of sand glued to construction paper.
MacOS just manages fonts and displays better, I guess.
First, your iMac is not a 2560x1440 screen, the 2017 would have been a retina 5120x2880. The retina display and the software stack behind it is an amazing accomplishment... and I say this as someone who was a Windows guy from 1995 to about 2015 who has never owned a non-retina modern Mac. (I now have... 3... non-retina vintage Macs, including one not even in my signature yet, but they were all acquired second-hand as vintage collectibles.)
Second, I don't think it's the OS as much as it is a couple of bigger things:
1) Windows aimed for more resolution independence; Apple did the whole 2x retina thing. Try running, say, a 4K external monitor on a Mac and my understanding is that your scaling options are... not ideal. But on the displays that Apple ships, the 2x retina approach is simpler. And well-implemented simplicity is a lot better than a more ambitious vision that doesn't actually get adopted.
2) Windows' attempt towards resolution independence have been stuck due to the fact that it is extremely difficult to get third-party developers to move towards newer APIs, etc. It's what I would call the "Vista effect" - ever since Vista was negatively received by the market, then effectively, third party vendors need to support the oldest-currently supported Microsoft OS until Microsoft stops doing so. So that means everything needs to run on XP until 2014, 7 until 2020, etc. Which means that if Microsoft added a great API to solve a problem in, say, Vista (2007), no one is going to touch it until at least 2015, eight years later. At least some third-party vendors were still supporting XP in 2015/2016 or... even later. The era of most software in 1996 requiring Windows 95 which was released in 1995 is... completely over... in Windowsland. In Macland, well, most software
today requires at least Big Sur (2020), and as someone who recently revised a late 2013 retina MBP that only goes to Big Sur without OCLP, I can tell you there are even some little utilities out there where the newest versions require Monterey or Ventura.
I would further add that the Windows software ecosystem is increasingly atrophying - no one writes new software for Windows, only Chrome/Electron. Older software tends to have been sold to new owners who have laid off most of the development teams and implemented new licensing models, so people don't want to go from perpetual licences they paid for to paying a huge amount annually.
(Really, I would you, with the benefit of hindsight, that the XP/Vista debacle basically killed the Windows platform in slow motion. Doesn't help that Windows 8's insanity came along right at a time when the ship was perhaps righting itself a little.)
3) There's a major chicken-and-egg problem - Windows people, especially corporate IT types, do not want to touch high-resolution screens that require scaling because, well, they don't have the patience to deal with those glitches. And since no one serious, to this day, runs Windows on displays requiring scaling, well, the incentive for third-party developers is not there.
One of the strengths and weakness of the post-return-of-Steve-Jobs Mac world is that there's very much a 'move fast and break things' mentality - annual OS releases, an eagerness to abandon old things, etc. A lot of good software has been lost along the way (e.g. why can I not play Spaceward Ho 5.0 for Mac on anything newer than Snow Leopard? I haven't tried in years, but there's a good chance Spaceward Ho
4.0 for Windows will run on Windows 11. And let's not talk about all the 32-bit Intel games), but the software that has stuck around understands that they have to do things Apple's way or be left behind. It's one of the reasons that most of the big software vendors made the move to Apple silicon so quickly (and so much quicker than either PPC or Intel) - after close to two decades of this, they understand that you can't diverge too much from the Apple development tools, the Apple APIs, etc.
Similarly, a lot of good hardware has been e-wasted over the years that could have met many people's needs (look at the disastrous state of web browser support on older Macs - meanwhile, you can crawl Windows 10 or, unsupportedly, 11, on pretty much every machine from 2004-5 forward and have a modern, currently supported web browser).
But, as much as lots of things fall behind
The reality, in my mind, is that, to this day, you cannot do a high-resolution screen on Windows. Either you put such a screen in and hope for the best with third party software's poor scaling abilities (which, to be clear, is a lot better than ten years ago), or you put in a screen that doesn't require scaling, in which case you get great software compatibility but the results look like garbage compared to a retina Mac.
What screen resolution is your 17" Envy?