Longish story.
Eventually php/ucb/group.php is run
The URL is split up with:

list($_,$group,$subpage,$selector,$subselector) = $temp;
This code gets run:
/** Get information about this group, if there is one.            
 * Process this information to decide how to handle the request. 
 */
$groupinfo = group_get($group);
$done = 0;
if (!$groupinfo) {
...
~www/php/include/group.inc.php contains:
/** Read the information from an existing group. Returns 
 * null if the group doesn't exist.
 * Besides the column names of the "groups" table as keys of the returned 
 * array, another key is added: "hasPubs".                
 */
function group_get ($groupname) {
    global $siteConfig;
    $result = sqli_select_row(getDBName("auth"),
                        "select * from groups where groupname = ?",
                        's', $groupname);
    if ($result &&
        sqli_exists(getDBName($siteConfig['siteGroupName']), 'pubGroups')) {
        $query = "select pubid from pubGroups where groupname = ?";
        $r = sqli_select_field(getDBName($siteConfig['siteGroupName']),
                               'pubid', $query, 's', $groupname);
        $result['hasPubs'] = $r ? 1 : 0;
    }
    return $result;
}
That the getDBName("auth") call determines which site we are on and returns something like "auth_7".

The hasPubs code is a hack and should be fixed.

BTW - typically the global PhP variable $group is set to the group name, so if a function calls global $group, then that group can be used within the function.