Once redirected by Rewrite rules, how can WordPress know the page?

Parsing of the requested URL happens in the file wp-includes/class-wp.php. The magic happens starting at line 148 in the parse_request function. For path info style permalinks, $_SERVER['PATH_INFO'] is used, for pretty permalinks, $_SERVER['REQUEST_URI'] is used.