The layer window works like this:
When a layer is selected and you click the button to make it invisible, the next lowest layer that is visible becomes selected. (I wish it didn't do that, but it does.)
When a layer is not selected and you click the button to make it invisible, the selection does not change.