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 = [

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`.
        "/lib" # FIXME: remove and update debug-info.nix

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?