It's definitely not all about compensation, and it's not just an industrial move away from the US. I personally chose to do my CS PhD studies in Canada rather than at (better funded, higher-status) American options, after leaving a US undergrad. Those other options would've been strongly preferable had it not been for my experience with US culture during undergrad; as it was, US culture made clear to me that staying there was out of the question.
More than a dozen of my friends who graduated at the same time did similarly, both those who went on to grad school and those who went into industry. This wasn't because there weren't options for us in the US — we all had choices. The honest truth is that, among those bright people I knew in undergrad, the large majority (Americans and international alike) were wholly disgusted by the US in recent years, and being unable to effect any change, they left the country.