There are many situations in which popup windows are currently used in modern UIs. Their primary use appears to be when displaying an error message or other descriptive information is desirable, without disturbing the content of the currently displayed interface to the user, at the cost of disrupting the user in the process.
This allows the system to be abstracted into its own separate notification stack, which is useful for, for example, OS-level services that may not be cognizant of the running application but still need to display information about its state (such as when it crashes, when an update is required, or when it fails driver signing). This is used similarly in web programming, but to a far more dubious degree in this author's humble opinion.
We also need the notion of display priority to frame my question. For sake of counter-definition, we will define a popunder as a popup window with lowest display priority. This variation on popup messages appears to serve no purpose other than to obscure the desired window content, which is useful for persisting user attention beyond the scope of the currently running interface. These allow for marketing and exit path messages from the current interface, which, by definition of closing or migrating away from the interface, persist beyond the user's desire to interact with it any further. I would thus class this strategy as lacking empathy for the expensiveness of user attention, thus lacking merit, but I could be very mistaken.
However, given this base intuition, the messages that I am most interested in are popup messages higher than the lowest display priority, typically with higher display priority than the window the user is currently interacting with.
My question, then:
In which situations are popup windows at non-minimum display priority most appropriate? There are several cases in which they are used, but many of these cases seem to lack robustness, empathy for the user, or cognizance of proper flow of interaction. Specifically, I am looking for a unifying pattern or set of guiding examples within which to frame my decisions to or to not use a popup message, especially when an alternative strategy, such as when an in-page error message or when other modal UI strategies are more appropriate.
My intuition is that they are useful only in cases where user interruption is immediately desirable or in cases where an alternative notification strategy is expensive to provide. But, I can think of no robust examples for the former or justifiable situations for the latter, and I would like to formalize this if I can.