What's the differenct between nixpkgs.config.firefox and nixpkgs.overlays for firefox?

I want to install a NativeMessagingHost.

  nixpkgs.config.firefox = {
    forceWayland = true;
    extraNativeMessagingHosts = [ pkgs.jabref ];

doesn’t work for me but

  nixpkgs.overlays = [
    (self: super: {
      firefox = pkgs.wrapFirefox pkgs.firefox-unwrapped {
        forceWayland = true;
        extraNativeMessagingHosts = [ pkgs.jabref ];

works. What’s the difference?

nixpkgs.overlays applies overlays to packages. nixpkgs.config contains config variables like { allowBroken = true; allowUnfree = true; } which require extra code to function.

When does nixpkgs.config.firefox work? This method is also documented but it seems not all args work.

When the firefox wrapper uses it https://github.com/NixOS/nixpkgs/blob/af8d62fc40483aa04016c03743d198da25ea9320/pkgs/applications/networking/browsers/firefox/wrapper.nix#L38

I am surprised.

its not freeform text. It only works with the arguments that are implemented.

Oh, I got it. It must be taken from config.${applicationName}. Thanks!