What factors determine application fees? I have no serious need to know the answer to this question, but I'm mostly just curious (after applying for undergraduate schools 4 years ago and applying for graduate schools now). 

What sorts of expenses are institutions trying to pay for when requiring application fees for the applications? Why is there a wide range of fees? (I know Stanford graduate school is $125, and Chicago is $55, and I've only applied to 5-6 schools so far.) Are the institutions just breaking even, or do some of them use their prestige to earn a little extra money?
Application fees are primarily there to moderate the number of applications and in the case of universities receiving huge numbers of applications partially finance the application process. There is of course many services for which one can argue to cover costs. This includes personnel to handle applications, personnel to evaluate applications, costs for paper handling (at least earlier including postage if anything had to be handled through regular mail). When looking at the costs for taking in the money and possibly distributing it within a system that likely involve many persons it becomes clear that a well defined cost analysis is not likely done, it is not cost effective. Instead the pricing can be used to signal, for example, prestige and to ward off chance applications. The level of the  pricing will likely be determined by these factors but also include considerations to what levels will be reasonable for the uptake of students visavi ethical and social goals for the university. In short, the pricing is more of a tool "for" recruitment than a precise estimate for the costs involved in the application process.