What is the difference between the $config and the $settings variables in settings.php? In the settings.php file of Drupal 8 installations, there are two different types of variables; $settings and $config. In Drupal 7 we used only $conf variable.

What's the difference between $config and $settigns variables in D8?
Settings are for early-bootstrap (you can't store the database credentials in the database) and environment specific things, like the path to the public file system. Things that are not meant to be exported/deployed.

That means in almost all cases in modules, you want to use the configuration API.