Web.config file is used to set configuration about your webapplication or we can say in other words that it is used to override defaultapplication configuration information and it is used to set global information.For example suppose you want to store connection string for your webapplication then it is good practice to store it in web.config file. Web.configfile is written in xml language.
1. We can use web.config file for authentication and authorization purpose.
2. We can use web.config file for custom error purpose.
3. We can use web.config file for personalization and theme purpose etc.
For more details in web.config file please search it on google.