Why are there 2 ways to handle configuration? In Drupal when we are working with read-only config we use

$page_cache = \Drupal::config('system.performance')-&gt;get('cache.page');


Why this static call for read-only object?

and when we use working with a config where both read and write is possible. we use this service 'config.factory'

$config = \Drupal::service('config.factory')-&gt;getEditable('system.performance');
$config-&gt;set('cache.page', ['enabled' =&gt; 1, 'max_age' =&gt; 5]);


what leads to this design?
This change record explains it all: Configuration objects by default are immutable.


  ConfigFactoryInterface::get() no longer returns configuration
  objects that can be saved. This is to ensure that configuration
  overrides do not get into active configuration. Configuration
  overrides are, for example, global overrides set in settings.php or
  translations provided by the locale module. If you need to get a
  configuration object that can be saved, use
  ConfigFactoryInterface::getEditable(). Objects returned by that
  method will not have overrides applied.
  
  Previously

// Just get the site name (with overrides).
$site_name = \Drupal::config('system.site')-&gt;get('name');

// Set the site name.
\Drupal::config('system.site')-&gt;set('name', 'My fantastic site')-&gt;save();

  
  Now

// Just get the site name (with overrides, same as before).
$site_name = \Drupal::config('system.site')-&gt;get('name');

// Set the site name.
\Drupal::configFactory()-&gt;getEditable('system.site')-&gt;set('name', 'My fantastic site')-&gt;save();



Are you also/alternatively asking why there's a Drupal::config method, but not a Drupal::configFactory method, i.e. why do you have to use the generic Drupal::service method for the second one?

If so, that's simply because the shortcut methods exposed on the Drupal class are for the most regularly used services. The config service is used in procedural code a lot more than config.factory, so there's no shortcut method for it. There are hundreds (thousands?) of services throughout the system so providing a method for each would be overkill