A lot of applications don't really seem to care what the users doing. If they want to tell you something they just pop to the top of the stack, grab focus and you end up typing in a random dialog box (and often hitting the default button before you have time to react)
Some are smarter. They do things like flash the icon in the task list to tell you it would like your attention if you have a moment to spare.
Some, like UAC, usually totally take over the desktop as a modal dialog so you can't do anything until you're responded to their demands.
The most annoying though have to be the ones that are so self-effacing that they pop up a dialog buried in the hierarchy of desktop windows such that not only do you not notice the only way to find this vital message that's stopping the application proceeding (and giving a good impression that it's either hung or doing something incredibly complex that's going to take hours) if to minimize every other window because it doesn't even surface on an alt-tab.
I'm probably a nightmare user for usability testing. I have half a dozen windows open at once and I often install/try/throw away random apps (one of the great things working at Microsoft is the sheer number of stuff you can play with!) but it also means I've got various things in various states at various times and one dialog either hiding or demanding I look at it now can really throw my equilibrium.
With over a decade of legacy support built into Windows and various program and programmer specific notification methods available it's hardly surprising that this problem exists but it would be nice to see v.Next start to introduce maybe a common notification mechanism that consistently keeps the user informed but at the same time in control.
Growl for OSX is a great start in this direction - a common notification platform with application specific branding but a central user control model so the end user can define how apps are allowed to notify them