The system automatically redirects users to login to the last page they were previously on when they were logged out, as a matter of convenience. So if you were logged in as an admin, and you also went to a client profile and clicked to "Login as Client", you would be in the client interface. If at this point you were to logout, the last page you were on was in the client interface, and upon logging in again, you would be redirected to that page.
I found it kind of annoying myself to login to the admin interface and be redirected to the client interface in these cases, so I changed it in CORE-2166 for v4 to no longer redirect to an alternate private interface. It's still possible to be redirected to the public interface on login, though, if that was where you had logged out previously.
i.e.
This won't happen anymore:
But this can still happen: