When a
J2EE web container receives
any request, it first checks it's list of servlet mappings from web.xml. Only if the request is not found in that list does it assume it's a file and display the file. If it is found, it calls the servlet.
In high volume sites, quite often there is a layer of one or more web servers that receive the initial request and then forward the request to the app servers. In this case, there is some type of plugin to the web server that tells it which requests to respond to and which to pass on to the application server. In this case, the data in web.xml is passed on to the web server in some manner (e.g. put in a config file and copied to the web server).