I personally find Lightroom's undo behavior maddening. I may make a couple changes to an image then flip back and forth between two images to see how that changes feels against a similar image. Undo in this case is broken — it undoes my changing images, not my image edits.
I believe they came up with this undo behavior to manage a specific case: if I make an edit to an image, then switch images, then undo, what should happen? The image that the last edit was done to isn't currently in view. By making navigation and UI changes part of the undo stack, the last image edit undo will always be applied to the currently-focused image.
My instinct, though, would be to automatically switch the user to the image that the last edit was applied to. This is common behavior in text editors — if I undo the last text change but it's out of the current view, the document scrolls to the position of the last change.
Text editors also behave as I expect with regards to different open documents. Each document has an undo stack and hitting 'undo' in any individual document will never effect any other document.
It's possible that they tested the system they landed on and it was too confusing for folks, or that the specific population of Lightroom users found it much better. I find it nonsensical.
One way I've come up with that they could manage this would be to have an 'entire app' undo command and an 'only edits' undo command. If I need to find that image again that I navigated away from I can use the 'entire app' undo. If I just want to undo the edits to the current image, I can use the 'only edits' command.
I found one compelling use case for applying undo to selections, via this post. If you're working on making a complex selection of many images, you can easily lose your work if you accidentally forget to keep holding down CMD/CTRL. Being able to undo a selection means you can quickly get back the complex selection that you had before the errant click.
I think this is more evidence for the need for two types of undo commands.