Liberal arts degrees subsidize the hard science and engineering degrees since the per-credit-hour tuition is the same but the guy doing gender studies is way cheaper than the girl using the microbiology lab.
In many cases grant overhead doesn't even pay for the cost of research; only the top-tier research universities are particularly successful at pulling in enough, and big enough, grants to do that (see this from Georgia Tech's former Computer Science dean: http://innovate-wwc.com/2011/05/18/if-you-have-to-ask-ten-su...).
The liberal arts, meanwhile, are so cheap to teach that in many cases they are actually making money, i.e. their expenses are lower than tuition fees, and the remaining tuition is used to cross-subsidize science education: http://www.today.ucla.edu/portal/ut/bottom-line-shows-humani...