One of the great benefits of the web application business is that startup costs are generally fairly low compared to brick and mortar businesses. Web hosting is getting cheaper and programming costs usually do not exceed 6 figures. So what are most of these millions being put into?
For many eBusinesses, like Facebook for example, large sums of money are being put into the founders pockets.
Seriously a business is not valued simply on costs; many times a potential investor can see value in a business that is a lot more than simply what it cost to put together.
Suppose you spent a year building a web business and it attracted a million paying customers in the first month it was live. Then Microsoft called you up and asked to buy 10% of your company would you start thinking "lets see, we spent X on servers and Y on food..."
Of course not, you would think "Lets see, I have a million paying customers right now which will generate a profit of Z this year plus we are growing a Y rate per month so at this rate next year we will make...."