Does hook_install() get called before or after configuration yml files are loaded?
When Drupal install a module, first it installs the default configuration of the module, then it invokes its hook_install(). This is evident from ModuleInstaller::install(), which contains the following code.

  // Install default configuration of the module.
  $config_installer = \Drupal::service('config.installer');
  if ($sync_status) {
    $config_installer
    -&gt;setSyncing(TRUE)
      -&gt;setSourceStorage($source_storage);
  }
  \Drupal::service('config.installer')-&gt;installDefaultConfig('module', $module);

  // If the module has no current updates, but has some that were
  // previously removed, set the version to the value of
  // hook_update_last_removed().
  if ($last_removed = $this-&gt;moduleHandler-&gt;invoke($module, 'update_last_removed')) {
    $version = max($version, $last_removed);
  }
  drupal_set_installed_schema_version($module, $version);

  // Ensure that all post_update functions are registered already.
  /** @var \Drupal\Core\Update\UpdateRegistry $post_update_registry */
  $post_update_registry = \Drupal::service('update.post_update_registry');
  $post_update_registry-&gt;registerInvokedUpdates($post_update_registry-&gt;getModuleUpdateFunctions($module));

  // Record the fact that it was installed.
  $modules_installed[] = $module;

  // Drupal's stream wrappers needs to be re-registered in case a
  // module-provided stream wrapper is used later in the same request. In
  // particular, this happens when installing Drupal via Drush, as the
  // 'translations' stream wrapper is provided by Interface Translation
  // module and is later used to import translations.
  \Drupal::service('stream_wrapper_manager')-&gt;register();

  // Update the theme registry to include it.
  drupal_theme_rebuild();

  // Modules can alter theme info, so refresh theme data.
  // @todo ThemeHandler cannot be injected into ModuleHandler, since that
  //   causes a circular service dependency.
  // @see https://www.drupal.org/node/2208429
  \Drupal::service('theme_handler')-&gt;refreshInfo();

  // In order to make uninstalling transactional if anything uses routes.
  \Drupal::getContainer()-&gt;set('router.route_provider.old', \Drupal::service('router.route_provider'));
  \Drupal::getContainer()-&gt;set('router.route_provider', \Drupal::service('router.route_provider.lazy_builder'));

  // Allow the module to perform install tasks.
  $this-&gt;moduleHandler-&gt;invoke($module, 'install');


The first lines I quoted are for installing the default configuration, while the last one is for invoking hook_install().