Well, it comes from reading HN. :) That's clearly anecdotal, but if you're a regular reader you've surely come across the job-hopping advice here! I've seen "the way you get a raise is by switching companies" as advice over and over
and over here, and I don't think it's just a small selection of malcontents I just keep running into.
Companies whose primary business is hardware seem to be more likely to keep people around for longer periods of time -- Apple, Intel, Cisco, National Semiconductor back when they were a going concern. Software companies, though, particularly ones in Silicon Valley (or following a Silicon Valley ethos)? As someone who's going to hit their four-year anniversary at their current workplace in a week, I feel like the oddball.