This is completely guesswork:
In the old days, filling a rectangle with color was relatively slow. But filling one large rectangle was much faster than filling a large number of small rectangles.
I assume that if you had a window with a child window, and both had the same registered background brush, then Windows was smart enough to realize that it did not need to send WM_ERASEBKGND to the child when it already cleared the parent. With a moderately complex dialog box on a very slow PC, this can be a significant improvement.
source share