The first way is fairly prosaic: lots of Silicon Valley companies are in the business of selling stuff to the NSA: storage hardware, sophisticated communications equipment, data analytics software, and more. But while this may have increased recently, it's not fundamentally new. It's just the latest high-tech twist on the good old military-industrial complex. But there's a second way that the interests of Fort Meade and Santa Clara County have converged: these days, they're fundamentally in the same business. The NSA calls it surveillance, and all the rest of us just call it spying. Silicon Valley, conversely, wouldn't be caught dead calling it that. They call it "targeted advertising" or "monetizing the social networking." But it's pretty much the same thing.
Read related article, "Big Data And Big Brother: Madison Avenue’s Big Moment To Decide."