Develop theme with demo default content, programmatically create pages

use after_setup_theme create your post and tags then save the data, add option key and only run your setup once,

i.e.

add_action( 'after_setup_theme',  function() {
    
    $setupKey = 'my_theme_activated';

    $setupAlreadyRun = get_option($setupKey);

    if ( $setupAlreadyRun )
        return;

    my_theme_setup( $setupKey );

});


function my_theme_setup( $setupKey ) {
    $posts = [
        [
            'post_title'        => 'Project Page',
            'post_type'         => 'page',
            'post_status'       => 'publish'
        ],
        [
            'post_title'        => 'Another Project Page',
            'post_type'         => 'page',
            'post_status'       => 'publish'
        ],
        [
            'post_title'        => 'Another Last Project Page',
            'post_type'         => 'page',
            'post_status'       => 'publish'
        ]
    ];

    $postIDs = [];

    foreach( $posts as $post ) {
        $postIDs[] = wp_insert_post( $post );
    }

    $tag = wp_insert_term('My Project Tag', 'post_tag');

    // What else you want to do here.



    //Save data in options table in case you want to do something with the automated setup ids, 
    if ( is_array( $tag ) && isset( $tag['term_id'] ) )
        update_option('my_auto_setup_tag', $tag['term_id']);

    update_option('my_auto_setup_pages', implode(',', $postIDs ) );
    update_option($setupKey, 1 );
}