In construct_forum_bit you can find this line:
PHP Code:
$forum = $vbulletin->forumcache["$forumid"];
$vbulletin->forumcache is the unserialized array from table datastore, title = forumcache
The cache is build from table forum by build_forum_permissions() in includes/adminfunctions.php, when a forum is added/modified, permissions changed, etc.
As this is cached data, it does not necessarily contain the current values for replies, threads, etc.
This is where cache_ordered_forums() comes into play:
It reads the current data from table forum (and other tables if necessary), merges them into $vbulletin->forumcache
To answer such questions yourself, you have to track down the data flow.