How is $current_page passed in woocommerce_account_orders function?

Action hooks can pass variables do hooked callback functions. For example:

do_action( 'my_custom_action', $a_variable );

For that action, any callback function has access to $a_variable:

add_action( 'my_custom_action', 'my_custom_function' );

function my_custom_function( $a_variable ) {
     // etc.
}

The woocommerce_account_orders_endpoint action hook is defined like this:

do_action( 'woocommerce_account_' . $key . '_endpoint', $value );

Where $value would be passed to woocommerce_account_orders() which uses it as the $current_page argument.