Palette Levels

When 2 or more palettes meet on the screen, is there a way to force which one is on top and which one is hidden?
It seems they flip positions, but I'm not sure of the parameters making those decisions.