In GNOME bug 85793, someone points out that when a session is restored, the windows are restored out of order. (The z-order is the depth of the window in the stack on the screen, so called by analogy with Cartesian X and Y coordinates.) So if a window was on top when you logged out, it might be on the bottom when you logged back in.
Session restoration is currently broken anyway, but whether we fix that by making sessions work again or by implementing window matching, we need to make sure that z-order is restored correctly.
Photo © Leo Reynolds, cc-by-nc-sa. Mashup of previous Flickr work. Isn’t free content wonderful?