Its for skills that cant be found locally. The latest cutting edge research is done in universities and as the majority of grad students are foreigners if companies want people with reseaerch experience at the cutting edge they need foreign students. Students are getting H1Bs because the US immigration system is so screwed that it has no specific visa for Students who have graduated from US universities to stay and work in US (every other country which has a large education industry has a student work visa post graduation) so they use the H1B which was meant for Models.
Also mostly students are now spending 2-3 years in OPT so by the time they are on H1B they have the skills and the experience.
All this would not be needed if the Comprehensive Immigration Reform under Bush had got passed which had basically said every student graduating in STEM would have a Greencard stapled to their Diploma.
GCs are always better than H1Bs as they have the same freedom to work for anyone and do not depress the market like H1s do.