Why was the transition to HiDPI so much less painful on macOS, then?
Because Apple designed the core OS to handle it much better, and make it easier to support for developers. (which was years in the making, far before the launch of rMBP.)
While I agree that the OS X APIs were superior at the time, it is important to remember that Windows was and still is an enterprise OS, first and foremost, and this is a big mess. So this slowed progress a lot. Modern Windows UI frameworks are good too, but they are used very seldom, or if used, often used incorrectly. Since high DPI displays have been rare and expensive, I think also developers have very little awareness of the problems, and much less will to work on it. Linux is in the same boat.
Sure, but their hi-DPI approach was much more backwards compatible capable than Microsoft's. Having apps still work, but be tiny and unreadable or haveing their UI exploded all over the place isn't a great exampe of backwards compatibility.
Not it was easier because they also control the hardware and defined HiDPI to be always exactly 200%, compared to various scaling factors that windows needs to support.
Because Apple designed the core OS to handle it much better, and make it easier to support for developers. (which was years in the making, far before the launch of rMBP.)