Does anyone know what happens behind the scenes when one changes the number of posts displayed on a page via the admin panel (Reading Settings)? How does WP calculate the $max_num_page value (for pagination links) based on the $posts_per_page value? Which WP template(s) or core files are involved in this calculation process? I'd like to understand the logic WP uses to calculate the $max_num_page value. Thanks.