Before you build a portal there is a web.config file that is copied into the root of the virtual directory at creation time.
C:Program FilesCommon FilesMicrosoft Sharedweb server extensions60CONFIG
It merges other config files into the final one if they are named correctly notice the
This is merged in at creation time.
As per MSDN