Configuration in Drupal is stored in the database and can be imported from and exported to the filesystem. But there are times when it is necessary to apply a set of changes to the existing configuration outside of this system. A common reason is to set attributes on a specific environment. In Drupal 7, there was the global $conf variable, which could be manipulated in the settings.php file to provide this functionality.
A major challenge with the approach in Drupal 7 is that any overrides could not be distinguished from other settings. From the point of view of a configuration form, there was no distinction between attributes coming from the database or from the override. This means that if the configuration form were submitted, it would save the override to the database. In Drupal 8, these overrides are maintained as a layer on top of the existing configuration and it does not use them on configuration forms.
In Drupal 8, the $conf variable has been renamed $config and can still be set from the settings.php file, using the same nested array syntax as Drupal 7. For example, to get the system maintenance message, you would use this:
$message = \Drupal::config('system.maintenance')->get('message');
If you wanted to override that, you would override it using this:
$config['system.maintenance']['message'] = 'The site is down.';
Additional levels can be traversed using nested array keys. If you need access to $config outside of the settings.php file you need to first declare it using global $config.