A collection of web.config modifications is a set of commands that, when processed by the web.config manipulator in Windows SharePoint Services, change the state of the web.config file. You can string together a set of these commands to ensure that they apply the desired tags and attributes within web.config. Each modification is expressed as an object in the administrative object model.
Use the WebConfigModifications property of the SPWebApplication or SPWebService class to get the collection of web.config modifications either in the Web application or in all Web applications within the Web service. To apply modifications that you define through the SPWebConfigModification class to the web.config files in the server farm, call the ApplyWebConfigModifications method on the current content Web service object, as follows: SPWebService.ContentService.ApplyWebConfigModifications.