Vamshi,
looking at the code quickly here is how the redirection seems to work. On every request to an OpenACS server the proc rp_filter will run (see acs-tcl/tcl/request-processor-procs.tcl). In that proc
permission::require_permission -object_id [ad_conn object_id] read
will be invoked if we are in a user page and the same command with privilege admin is invoked if a page under package-uri/admin is requested.
The proc permission::require_permission will redirect the user to the login page if he doesn't have permission and isn't already logged in. If the user is logged in and doesn't have permission a permission denied page will be displayed instead.