Curious about the role of `environment.pathsToLink` in many modules

In nixos/modules/config/xdg/autostart.nix, the following code block (let’s call it (A) code block) populates .desktop files in /run/current-system/sw/etc/xdg/autostart folder if config.xdg.autostart.enable is set to true (which is the default value).

(A) code block

  config = mkIf config.xdg.autostart.enable {
    environment.pathsToLink = [
      "/etc/xdg/autostart"
    ];
  };

However, in nixos/modules/config/system-path.nix, the following code always populates /run/current-system/sw/etc/xdg which obviously includes /run/current-system/sw/etc/xdg/autostart.

  config = {

    environment.systemPackages = requiredPackages ++ config.environment.defaultPackages;

    environment.pathsToLink =
      [ "/bin"
        **"/etc/xdg"** ## This part populates any files under `/run/current-system/sw/etc/xdg`.
        "/etc/gtk-2.0"
        "/etc/gtk-3.0"
        "/lib" # FIXME: remove and update debug-info.nix
        "/sbin"
        "/share/emacs"
        "/share/hunspell"
        "/share/nano"
        "/share/org"
        "/share/themes"
        "/share/vim-plugins"
        "/share/vulkan"
        "/share/kservices5"
        "/share/kservicetypes5"
        "/share/kxmlgui5"
        "/share/systemd"
        "/share/thumbnailers"
      ];
...(omitted)...

I’ve experimented the (A) code block and indeed erasing just (A) code block does not prevent /run/current-system/sw/etc/xdg/autostart from being made.

Then, why does the (A) code block exists in nixos/modules/config/xdg/autostart.nix? There are other code blocks in other modules that populate folders under /run/current-system/sw/etc/xdg/autostart, doing similar job of the (A) code block. All of those code blocks seem to be be doing nothing. Why do they exist?

Or, is there any cases where nixos/modules/config/system-path.nix is not used? What am I mising?