By Windows 2000 Server, they finally had the architecture right, and had flushed out most of the 16 bit legacy.
The big win with Windows 7 was that they finally figured out how to make it stop crashing. There were two big fixes. First, the Static Driver Verifier. This verified that kernel drivers couldn't crash the rest of the kernel. First large scale application of proof of correctness technology. Drivers could still fail, but not overwrite other parts of the kernel. This put a huge dent into driver-induced crashes.
Second was a dump classifier. Early machine learning. When the system crashed, a dump was sent to Microsoft. The classifier tried to bring similar dumps together, so one developer got a big collection of similar crashes. When you have hundreds of dumps of the same bug, locating the bug gets much easier.
Between both of those, the Blue Screen of Death mostly disappeared.