What is public static function create() in plugins for? Sometimes I encounter a function public static function create with arguments in plugin classes.

For example, here https://www.sitepoint.com/tutorial-on-using-drupal-8-plugin-derivatives-effectively/
we can see it.

public static function create(ContainerInterface $container, $base_plugin_id) {
    return new static(
      $container-&gt;get('entity.manager')-&gt;getStorage('node')
    );
  }


Could you clarify me, what is the function for? What should it do and where is it used?
create() is a factory method for dependency injection.

Plugins which implement ContainerFactoryPluginInterface are instantiated by create() of the plugin class:

ContainerFactory::createInstance

public function createInstance($plugin_id, array $configuration = []) {
  ...
  // If the plugin provides a factory method, pass the container to it.
  if (is_subclass_of($plugin_class, 'Drupal\Core\Plugin\ContainerFactoryPluginInterface')) {
    return $plugin_class::create(\Drupal::getContainer(), $configuration, $plugin_id, $plugin_definition);
  }

  // Otherwise, create the plugin directly.
  return new $plugin_class($configuration, $plugin_id, $plugin_definition);
}