Teh StateChanged event always fires when click "x" at the top corner of the PaletteSet.
However, clicking "-" to set "auto-hide" on or off that causes the PaletteSet to be hidden partially (e.g. the PaletteSet's window bar is still visible while its working area is hidden. Iin this case, it is arguable to say a PaletteSet is visible or not :-() would cause the StateChanged event firing or not firing, depending on if the PaletteSet is docked or not.
In my test, if the PaletteSet is floating (not docked), then when the main part of the PaletteSet becomes hidden (automatically after mouse cursor leaves from it a few seconds), the StateChange event will not fire. When puttiing mouse cursor onto the PaletteSet's winodws bar to cause the PaletteSet working area being shown, the StateChange event also does not fire. That is, when the PaletteSet is floating, StateChanged event only fires when user click "x" or when your code to set PaletteSet.Visible=true.
When the PaletteSet is docked, clicking both "x" and "-" cuases StateChanged event fire with NewState index as "Hide". But "x" set entire PaletteSet invisible, while "-" leave the PaletteSet's window bar still docked and visible (auto-hide). Placing mouse curosr on the docked PaletteSet window bar causes the PaletteSet's work area poping out and StateChanged event firing with NewState index as "Show". However, when the PaletteSet's work area automatically hides back, no StateChanged event fires.
So, if you need to do something when the PaletteSet becomes fully invisible (clicked "x") or partially (auto-hiding), you need to do it depending on if the PaletteSet is docked or not, by examing PaletteSet.Dock property.