how to add a page to a plugin?

You can use the activation hook and call function wp_insert_post()

class MyPlugin {
    static function install() {
        $my_post = [
            'post_title'    => 'My page title',
            'post_content'  => 'My page content',
            'post_status'   => 'publish',
            'post_author'   => 1, // Set author id here
            'post_type'     => 'page',
        ];
        wp_insert_post( $my_post );
    }
}
register_activation_hook( __FILE__, [ 'MyPlugin', 'install' ] );