IIS 7 and Above
Configuration & Scripting
Web.config vs Location Tags in ApplicationHost.config
Re: Web.config vs Location Tags in ApplicationHost.config
Aug 25, 2019 05:57 AM|lextm|LINK
IIS Manager tends to save settings in web.config as much as possible, but if a section is locked down and changes must go to location tags in applicationHost.config, then it writes there as well.
If you really want to know the ideas behind, you can read articles such as https://docs.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/the-configuration-system-in-iis-7 You
can also refer to open source projects, such as Jexus Manager (an IIS Manager clone).