What is the difference between the config and the settings directories?
schema
This folder is used for schema related things. This is most often used to tell Drupal how custom configurations and configuration entities will be saved.
install
The folder can contain configurations, for example a view. All configurations will be installed; if any configuration fails, the module can't be installed.
optional
The folder can contain configurations, for example a view. All configurations will be installed if possible. If a configuration has missing dependencies, it won't be installed.

Configuration installation only happens when the module itself is installed. Optional configurations can install missing configurations when dependencies are met by a new installed module.